From 2379240ee79980e653972cb595e311d09b04944f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 10 Nov 2007 06:42:45 +0000 Subject: Do not return error when fprintf returns 0 in addmntent(). fprintf is considered failing if the return is less than 0 --- libc/misc/mntent/mntent.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libc/misc/mntent') diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c index a9024be88..3f46eb2d2 100644 --- a/libc/misc/mntent/mntent.c +++ b/libc/misc/mntent/mntent.c @@ -98,11 +98,8 @@ int addmntent(FILE * filep, const struct mntent *mnt) if (fseek(filep, 0, SEEK_END) < 0) return 1; - if (fprintf (filep, "%s %s %s %s %d %d\n", mnt->mnt_fsname, mnt->mnt_dir, - mnt->mnt_type, mnt->mnt_opts, mnt->mnt_freq, mnt->mnt_passno) < 1) - return 1; - - return 0; + return (fprintf (filep, "%s %s %s %s %d %d\n", mnt->mnt_fsname, mnt->mnt_dir, + mnt->mnt_type, mnt->mnt_opts, mnt->mnt_freq, mnt->mnt_passno) < 0 ? 1 : 0); } char *hasmntopt(const struct mntent *mnt, const char *opt) -- cgit v1.2.3