Fix mount points enumeration (platform quota) on Solaris

Per documentation, `getmntent` returns 0 on success and -1 on error.
This commit is contained in:
Mike Gelfand 2017-04-22 21:39:24 +03:00
parent 4f9d9ad92b
commit 6a15bc6742
1 changed files with 2 additions and 2 deletions

View File

@ -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)
{