summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)