Steve French noticed these warnings when building cifs.upcall:
Compiling client/cifs.upcall.c
client/cifs.upcall.c: In function 'usage':
client/cifs.upcall.c:204: warning: declaration of 'prog' shadows a global declaration
client/cifs.upcall.c:33: warning: shadowed declaration is here
Change the usage function to not take and arg and have it just use the global
"prog" variable. Fix a typo in the log message generated when an unknown
option is specified. Also getopt() always returns '?' when it sees an unknown
option so there's no point in printing it out.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit
fb47f5de055a444b8b7a4555da0160f8d624e286)
}
void
-usage(const char *prog)
+usage()
{
syslog(LOG_WARNING, "Usage: %s [-c] [-v] key_serial", prog);
fprintf(stderr, "Usage: %s [-c] [-v] key_serial\n", prog);
goto out;
}
default:{
- syslog(LOG_WARNING, "unknow option: %c", c);
+ syslog(LOG_WARNING, "unknown option: %c", c);
goto out;
}
}
/* is there a key? */
if (argc <= optind) {
- usage(prog);
+ usage();
goto out;
}