$NetBSD: patch-ae,v 1.1.1.1 2001/08/02 17:34:00 drochner Exp $ --- mpeg3io.c.orig Sun May 20 05:05:26 2001 +++ mpeg3io.c Tue Jul 31 17:57:27 2001 @@ -1,8 +1,8 @@ #include "mpeg3private.h" #include "mpeg3protos.h" -#include -#include +#include +#include #include #include @@ -88,27 +88,15 @@ int mpeg3io_device(char *path, char *device) { - struct stat file_st, device_st; - struct mntent *mnt; - FILE *fp; + struct statfs file_st; - if(stat(path, &file_st) < 0) + if(statfs(path, &file_st) < 0) { perror("mpeg3io_device"); return 1; } - fp = setmntent(MOUNTED, "r"); - while(fp && (mnt = getmntent(fp))) - { - if(stat(mnt->mnt_fsname, &device_st) < 0) continue; - if(device_st.st_rdev == file_st.st_dev) - { - strncpy(device, mnt->mnt_fsname, MPEG3_STRLEN); - break; - } - } - endmntent(fp); + strncpy(device, file_st.f_mntfromname, MPEG3_STRLEN); return 0; }