summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorKhem Raj <kraj@mvista.com>2007-11-10 06:42:45 +0000
committerKhem Raj <kraj@mvista.com>2007-11-10 06:42:45 +0000
commit2379240ee79980e653972cb595e311d09b04944f (patch)
tree4ecf797a9b7f9cc46331875b7c631a7debb417cb /libc/misc
parent693245823c91dbfd9fa84c6b16636d963edf7cf3 (diff)
Do not return error when fprintf returns 0 in addmntent().
fprintf is considered failing if the return is less than 0
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/mntent/mntent.c7
1 files changed, 2 insertions, 5 deletions
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)