From 6a15bc67426f0b8b233145b92bdfa1eaf09e02cc Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 22 Apr 2017 21:39:24 +0300 Subject: [PATCH] Fix mount points enumeration (platform quota) on Solaris Per documentation, `getmntent` returns 0 on success and -1 on error. --- libtransmission/platform-quota.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c index 5596e21de..ae5f0718b 100644 --- a/libtransmission/platform-quota.c +++ b/libtransmission/platform-quota.c @@ -89,7 +89,7 @@ static char const* getdev(char const* path) return NULL; } - while (getmntent(fp, &mnt)) + while (getmntent(fp, &mnt) != -1) { if (tr_strcmp0(path, mnt.mnt_mountp) == 0) { @@ -166,7 +166,7 @@ static char const* getfstype(char const* device) return NULL; } - while (getmntent(fp, &mnt)) + while (getmntent(fp, &mnt) != -1) { if (tr_strcmp0(device, mnt.mnt_mountp) == 0) {