checkpolicy: add noreturn attribute to usage()

While at it, make usage() static and mark its argument as const.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2017-03-05 18:13:01 +01:00 committed by James Carter
parent e720859f57
commit ef61dd7d4b
4 changed files with 4 additions and 4 deletions

View File

@ -124,7 +124,7 @@ static int write_binary_policy(policydb_t * p, FILE *outfp)
return policydb_write(p, &pf);
}
static void usage(char *progname)
static __attribute__((__noreturn__)) void usage(const char *progname)
{
printf("usage: %s [-h] [-V] [-b] [-C] [-U handle_unknown] [-m] [-M] [-o FILE] [INPUT]\n", progname);
printf("Build base and policy modules.\n");

View File

@ -102,7 +102,7 @@ static const char *binfile = "policy";
unsigned int policyvers = POLICYDB_VERSION_MAX;
void usage(char *progname)
static __attribute__((__noreturn__)) void usage(const char *progname)
{
printf
("usage: %s [-b] [-C] [-d] [-U handle_unknown (allow,deny,reject)] [-M]"

View File

@ -65,7 +65,7 @@ static const char *symbol_labels[9] = {
"levels ", "cats ", "attribs"
};
void usage(const char *progname)
static __attribute__((__noreturn__)) void usage(const char *progname)
{
printf("usage: %s binary_pol_file\n\n", progname);
exit(1);

View File

@ -36,7 +36,7 @@
static policydb_t policydb;
void usage(const char *progname)
static __attribute__((__noreturn__)) void usage(const char *progname)
{
printf("usage: %s binary_pol_file\n\n", progname);
exit(1);