From: Jordan Lee Date: Sun, 14 Jul 2013 23:00:39 +0000 (+0000) Subject: (trunk, libT) #5275: fix platform quota crash on solaris 2.12, patch by godot X-Git-Tag: 2.81~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4e0194ce2ecccc654d57d86de8e10f1c9d7fac1;p=transmission (trunk, libT) #5275: fix platform quota crash on solaris 2.12, patch by godot --- diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c index fbae54724..035590e6f 100644 --- a/libtransmission/platform-quota.c +++ b/libtransmission/platform-quota.c @@ -27,6 +27,9 @@ #endif #ifdef HAVE_GETMNTENT #ifdef __sun + #include + #include + #include #include #include #include @@ -73,16 +76,16 @@ getdev (const char * path) FILE * fp; #ifdef __sun - struct mnttab * mnt; + struct mnttab mnt; fp = fopen(_PATH_MOUNTED, "r"); if (fp == NULL) return NULL; - while (getmntent(fp, mnt)) - if (!tr_strcmp0 (path, mnt->mnt_mountp)) + while (getmntent(fp, &mnt)) + if (!tr_strcmp0 (path, mnt.mnt_mountp)) break; fclose(fp); - return mnt ? mnt->mnt_fstype : NULL; + return mnt.mnt_special; #else struct mntent * mnt; @@ -124,15 +127,15 @@ getfstype (const char * device) FILE * fp; #ifdef __sun - struct mnttab *mnt; + struct mnttab mnt; fp = fopen(_PATH_MOUNTED, "r"); if (fp == NULL) return NULL; - while (getmntent(fp, mnt)) - if (!tr_strcmp0 (device, mnt->mnt_mountp)) + while (getmntent(fp, &mnt)) + if (!tr_strcmp0 (device, mnt.mnt_mountp)) break; fclose(fp); - return mnt ? mnt->mnt_fstype : NULL; + return mnt.mnt_fstype; #else struct mntent *mnt;