From 3724317e223d46908aac2405bbd73ea2de4f36e5 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Mon, 23 Mar 2009 17:13:01 -0400 Subject: In recent Fedora builds, the '-D _FORTIFY_SOURCE=2' compile flag has been set. This cause warnings to be generated when return values from reads/writes (and other calls) are not checked. The patch address those warnings. Signed-off-by: Steve Dickson --- utils/mount/fstab.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'utils/mount') diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c index e19e58b..7668167 100644 --- a/utils/mount/fstab.c +++ b/utils/mount/fstab.c @@ -546,8 +546,12 @@ update_mtab (const char *dir, struct mntent *instead) * from the present mtab before renaming. */ struct stat sbuf; - if (stat (MOUNTED, &sbuf) == 0) - chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid); + if (stat (MOUNTED, &sbuf) == 0) { + if (chown (MOUNTED_TEMP, sbuf.st_uid, sbuf.st_gid) < 0) { + nfs_error(_("%s: error changing owner of %s: %s"), + progname, MOUNTED_TEMP, strerror (errno)); + } + } } /* rename mtemp to mtab */ -- cgit