@@ -36,10 +36,11 @@
static policydb_t policydb;
-static __attribute__((__noreturn__)) void usage(const char *progname)
+static __attribute__((__noreturn__)) void usage(const char *progname,
+ int status)
{
printf("usage: %s binary_pol_file\n\n", progname);
- exit(1);
+ exit(status);
}
int render_access_mask(uint32_t mask, avtab_key_t * key, policydb_t * p,
@@ -395,7 +396,7 @@ int main(int argc, char **argv)
struct policy_file pf;
if (argc != 2)
- usage(argv[0]);
+ usage(argv[0], 1);
fd = open(argv[1], O_RDONLY);
if (fd < 0) {
This allows dispol command to exit successfully after printing help messages. Signed-off-by: Masatake YAMATO <yamato@redhat.com> --- checkpolicy/test/dispol.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)