From 78e66b1e90ca6124fbdcba490958923c7243f128 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Fri, 10 Jan 2014 20:05:49 +0200 Subject: [PATCH] utils: fix error message in smackaccess perror() reports success when validation fails. This patch makes the error message explicit. Invalid input is the most probable case. Also, error message is prefixed with the basename of the utility. Signed-off-by: Jarkko Sakkinen --- utils/smackaccess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/smackaccess.c b/utils/smackaccess.c index f524100..852b90d 100644 --- a/utils/smackaccess.c +++ b/utils/smackaccess.c @@ -38,7 +38,7 @@ int main(int argc, char **argv) ret = smack_have_access(argv[1], argv[2], argv[3]); if (ret < 0) { - perror("smack_have_access"); + fprintf(stderr,"%s: input values are invalid.\n", basename(argv[0])); return EXIT_FAILURE; } -- 2.7.4