Ticket #5275: transmission-trunk-r14119.diff

File transmission-trunk-r14119.diff, 1.3 KB (added by godot, 8 years ago)

Revised patch on top of r14119

  • libtransmission/platform-quota.c

    old new  
    2727 #endif
    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>
    3235   #include <sys/mnttab.h>
     
    7376  FILE * fp;
    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;
    8891
     
    124127
    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;
    138141