From 74fec59d7be4c993785bae386c10a0078e5b6d85 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Sat, 28 Jul 2007 17:51:06 -0400 Subject: [PATCH] mount.nfs: clean up a couple of printfs in fstab.c Clean up for consistent use. Signed-off-by: Chuck Lever Signed-off-by: Neil Brown --- utils/mount/fstab.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c index 6ac5c70..ec7ab52 100644 --- a/utils/mount/fstab.c +++ b/utils/mount/fstab.c @@ -25,6 +25,7 @@ #define streq(s, t) (strcmp ((s), (t)) == 0) #define PROC_MOUNTS "/proc/mounts" +extern char *progname; extern int verbose; /* Information about mtab. ------------------------------------*/ @@ -174,9 +175,8 @@ read_mounttable() { return; } if (verbose) - printf (_("mount: could not open %s - " - "using %s instead\n"), - MOUNTED, PROC_MOUNTS); + printf(_("%s: could not open %s; using %s instead\n"), + progname, MOUNTED, PROC_MOUNTS); } read_mntentchn(mfp, fnam, mc); } @@ -400,8 +400,10 @@ lock_mtab (void) { if (fcntl (lockfile_fd, F_SETLK, &flock) == -1) { if (verbose) { int errsv = errno; - printf(_("Can't lock lock file %s: %s\n"), - MOUNTED_LOCK, strerror (errsv)); + nfs_error(_("%s: Can't lock lock file " + "%s: %s"), progname, + MOUNTED_LOCK, + strerror (errsv)); } /* proceed anyway */ } @@ -528,8 +530,8 @@ update_mtab (const char *dir, struct mntent *instead) if (fchmod (fileno (mftmp->mntent_fp), S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) < 0) { int errsv = errno; - fprintf(stderr, _("error changing mode of %s: %s\n"), - MOUNTED_TEMP, strerror (errsv)); + nfs_error(_("%s: error changing mode of %s: %s"), + progname, MOUNTED_TEMP, strerror (errsv)); } nfs_endmntent (mftmp); @@ -546,8 +548,9 @@ update_mtab (const char *dir, struct mntent *instead) /* rename mtemp to mtab */ if (rename (MOUNTED_TEMP, MOUNTED) < 0) { int errsv = errno; - fprintf(stderr, _("can't rename %s to %s: %s\n"), - MOUNTED_TEMP, MOUNTED, strerror(errsv)); + nfs_error(_("%s: can't rename %s to %s: %s\n"), + progname, MOUNTED_TEMP, MOUNTED, + strerror(errsv)); } leave: -- 2.39.5