use __progname in mkreiserfs.c (try again)
PATCH 1/1 use __progname in mkreiserfs.c (try again)
Sorry for the re-post.
I think I mangled the previous diff in vi...
mkreiserfs_new.c renamed from mkreiserfs.c +8 -16
@@ -34,9 +34,8 @@# include <uuid/uuid.h> #endif +extern char *__progname; -char *program_name; -static void message (const char * fmt, ... ) __attribute__ ((format (printf,1 ,2 )));
@@ -50,7 +49,7 @@va_end ( args );if ( buf ) { -fprintf ( stderr,"%s: %s\n" , program_name, buf ); +fprintf ( stderr,"%s: %s\n" , __progname, buf );free ( buf ); } }
@@ -80,7 +79,7 @@" by end users only.\n" " -d | --debug print debugging information during mkreiser\n" " -V print version and exit\n" , - program_name); + __progname);exit (1 ); }
@@ -432,7 +431,7 @@if (*tmp) {reiserfs_exit (1 ,"%s: strtol is unable to make an integer of %s\n" , - program_name, str); + __progname, str); }return val;
@@ -447,7 +446,7 @@if (*tmp) {reiserfs_exit (1 ,"%s: strtoll is unable to make an integer of %s\n" , - program_name, str); + __progname, str); }return val;
@@ -461,7 +460,7 @@if (!is_blocksize_correct (*b_size))reiserfs_exit (1 ,"%s: wrong blocksize %s specified, " "only power of 2 from 512-8192 interval " -"are supported" , program_name, str); +"are supported" , __progname, str); }
@@ -478,7 +477,7 @@/* if (Journal_size < JOURNAL_MIN_SIZE) die ("%s: wrong journal size specified: %lu. Should be at least %u", -program_name, +__progname, Journal_size + 1, JOURNAL_MIN_SIZE + 1); */ }
@@ -560,13 +559,6 @@int c;static int flag; - program_name =strrchr ( argv[0 ],'/' ); - -if (program_name) - program_name++; -else - program_name = argv[0 ]; -if (argc <2 )print_usage_and_exit ();
@@ -673,7 +665,7 @@ } } -print_banner (program_name); +print_banner (__progname);if (mode &QUIET_MODE )fclose (stdout);