Changeset 14120


Ignore:
Timestamp:
Jul 14, 2013, 11:00:39 PM (8 years ago)
Author:
jordan
Message:

(trunk, libT) #5275: fix platform quota crash on solaris 2.12, patch by godot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform-quota.c

    r14117 r14120  
    2828 #ifdef HAVE_GETMNTENT
    2929  #ifdef __sun
     30   #include <sys/types.h>
     31   #include <sys/stat.h>
     32   #include <fcntl.h>
    3033   #include <stdio.h>
    3134   #include <sys/mntent.h>
     
    7477
    7578#ifdef __sun
    76   struct mnttab * mnt;
     79  struct mnttab mnt;
    7780  fp = fopen(_PATH_MOUNTED, "r");
    7881  if (fp == NULL)
    7982    return NULL;
    8083
    81   while (getmntent(fp, mnt))
    82     if (!tr_strcmp0 (path, mnt->mnt_mountp))
     84  while (getmntent(fp, &mnt))
     85    if (!tr_strcmp0 (path, mnt.mnt_mountp))
    8386      break;
    8487  fclose(fp);
    85   return mnt ? mnt->mnt_fstype : NULL;
     88  return mnt.mnt_special;
    8689#else
    8790  struct mntent * mnt;
     
    125128  FILE * fp;
    126129#ifdef __sun
    127   struct mnttab *mnt;
     130  struct mnttab mnt;
    128131  fp = fopen(_PATH_MOUNTED, "r");
    129132  if (fp == NULL)
    130133    return NULL;
    131   while (getmntent(fp, mnt))
    132     if (!tr_strcmp0 (device, mnt->mnt_mountp))
     134  while (getmntent(fp, &mnt))
     135    if (!tr_strcmp0 (device, mnt.mnt_mountp))
    133136      break;
    134137  fclose(fp);
    135   return mnt ? mnt->mnt_fstype : NULL;
     138  return mnt.mnt_fstype;
    136139#else
    137140  struct mntent *mnt;
Note: See TracChangeset for help on using the changeset viewer.