platform/unix.c
changeset 171 0d92d6358410
parent 145 d6385584f6c4
child 188 41bf2cb44d12
equal deleted inserted replaced
170:d826bf2c38c8 171:0d92d6358410
    80     int cd_count = 1;  /* We count the NULL entry. */
    80     int cd_count = 1;  /* We count the NULL entry. */
    81     struct statfs* mntbufp = NULL;
    81     struct statfs* mntbufp = NULL;
    82     int mounts;
    82     int mounts;
    83     int ii;
    83     int ii;
    84 
    84 
       
    85     BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
       
    86 
    85     mounts = getmntinfo( &mntbufp, MNT_WAIT );
    87     mounts = getmntinfo( &mntbufp, MNT_WAIT );
    86 
    88 
    87     for ( ii=0; ii < mounts; ++ii ) {
    89     for ( ii=0; ii < mounts; ++ii ) {
    88         int add_it = 0;
    90         int add_it = 0;
    89 
    91 
   122 {
   124 {
   123     char **retval = (char **) malloc(sizeof (char *));
   125     char **retval = (char **) malloc(sizeof (char *));
   124     int cd_count = 1;  /* We count the NULL entry. */
   126     int cd_count = 1;  /* We count the NULL entry. */
   125     FILE *mounts = NULL;
   127     FILE *mounts = NULL;
   126     struct mntent *ent = NULL;
   128     struct mntent *ent = NULL;
       
   129 
       
   130     BAIL_IF_MACRO(retval == NULL, ERR_OUT_OF_MEMORY, NULL);
   127 
   131 
   128     *retval = NULL;
   132     *retval = NULL;
   129     mounts = setmntent("/etc/mtab", "r");
   133     mounts = setmntent("/etc/mtab", "r");
   130     BAIL_IF_MACRO(mounts == NULL, ERR_IO_ERROR, retval);
   134     BAIL_IF_MACRO(mounts == NULL, ERR_IO_ERROR, retval);
   131 
   135