mount.nfs: clean up a couple of printfs in fstab.c
Subsystems (2)
PATCH 23/23 mount.nfs: clean up a couple of printfs in fstab.c
Clean up for consistent use.
Signed-off-by Chuck Lever <[email protected]>
---
utils/mount/fstab.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-)
utils/mount/fstab.c +12 -9
@@ -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. ------------------------------------*/
@@ -173,9 +174,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); }
@@ -399,8 +399,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 */ }
@@ -527,8 +529,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);
@@ -545,8 +547,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:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs