Skip to content

Commit

Permalink
Merge all the Unix __PHYSFS_platformDetectAvailableCDs() funcs into one.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 13, 2009
1 parent 07e97a0 commit d8d296e
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/platform_unix.c
Expand Up @@ -55,17 +55,13 @@ int __PHYSFS_platformDeinit(void)
} /* __PHYSFS_platformDeinit */


#ifdef PHYSFS_NO_CDROM_SUPPORT

/* Stub version for platforms without CD-ROM support. */
void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
{
} /* __PHYSFS_platformDetectAvailableCDs */
#if (defined PHYSFS_NO_CDROM_SUPPORT)
/* no-op. */

#elif (defined PHYSFS_HAVE_SYS_UCRED_H)

void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
{
int i;
struct statfs *mntbufp = NULL;
int mounts = getmntinfo(&mntbufp, MNT_WAIT);
Expand All @@ -84,12 +80,8 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
if (add_it)
cb(data, mntbufp[i].f_mntonname);
} /* for */
} /* __PHYSFS_platformDetectAvailableCDs */

#elif (defined PHYSFS_HAVE_MNTENT_H)

void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
{
FILE *mounts = NULL;
struct mntent *ent = NULL;

Expand All @@ -109,10 +101,8 @@ void __PHYSFS_platformDetectAvailableCDs(PHYSFS_StringCallback cb, void *data)
} /* while */

endmntent(mounts);

} /* __PHYSFS_platformDetectAvailableCDs */

#endif
} /* __PHYSFS_platformDetectAvailableCDs */


/* this is in posix.c ... */
Expand Down

0 comments on commit d8d296e

Please sign in to comment.