=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rdistd/filesys.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/rdistd/filesys.c 2014/07/05 07:58:41 1.14 --- src/usr.bin/rdistd/filesys.c 2014/07/05 10:21:24 1.15 *************** *** 1,4 **** ! /* $OpenBSD: filesys.c,v 1.14 2014/07/05 07:58:41 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: filesys.c,v 1.15 2014/07/05 10:21:24 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. *************** *** 29,34 **** --- 29,37 ---- * SUCH DAMAGE. */ + #include + #include + #include "defs.h" /* *************** *** 207,222 **** struct mntinfo * makemntinfo(struct mntinfo *mi) { - FILE *mfp; static struct mntinfo *mntinfo; struct mntinfo *newmi, *m; struct stat mntstat; mntent_t *mnt; int timeo = 310; ! if (!(mfp = setmountent(MOUNTED_FILE, "r"))) { ! message(MT_NERROR, "%s: setmntent failed: %s", ! MOUNTED_FILE, SYSERR); return(NULL); } --- 210,223 ---- struct mntinfo * makemntinfo(struct mntinfo *mi) { static struct mntinfo *mntinfo; struct mntinfo *newmi, *m; struct stat mntstat; mntent_t *mnt; int timeo = 310; ! if (setmountent()) { ! message(MT_NERROR, "setmntent failed: %s", SYSERR); return(NULL); } *************** *** 228,234 **** } mntinfo = mi; ! while ((mnt = getmountent(mfp)) != NULL) { debugmsg(DM_MISC, "mountent = '%s' (%s)", mnt->me_path, mnt->me_type); --- 229,235 ---- } mntinfo = mi; ! while ((mnt = getmountent()) != NULL) { debugmsg(DM_MISC, "mountent = '%s' (%s)", mnt->me_path, mnt->me_type); *************** *** 268,275 **** mntinfo = newmi; } ! (void) alarm(0); ! (void) endmountent(mfp); return(mntinfo); } --- 269,276 ---- mntinfo = newmi; } ! alarm(0); ! endmountent(); return(mntinfo); }