]> Devoid-pointer.net GitWeb - LFSBench.git/commitdiff
Use EXIT_SUCCESS and EXIT_FAILURE instead of hardcoded errors
authorMichal Malý <madcatxster@devoid-pointer.net>
Wed, 9 Jul 2014 10:24:21 +0000 (12:24 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Wed, 9 Jul 2014 10:24:21 +0000 (12:24 +0200)
main.c

diff --git a/main.c b/main.c
index 9e0b9797369fa153ca746cd6106b9069c36377c8..eccd386a4ce6ae8139ff59bb5cd4a7e31adf609c 100644 (file)
--- a/main.c
+++ b/main.c
@@ -39,25 +39,25 @@ int main(int argc, char** argv)
 
     if (caps == NULL) {
       fprintf(stderr, "CRITICAL: Cannot get advanced capabilites status.\n");
-      return -1;
+      return EXIT_FAILURE;
     }
     if (cap_get_flag(caps, CAP_DAC_READ_SEARCH, CAP_EFFECTIVE, &capfv) != 0) {
       fprintf(stderr, "CRITICAL: Cannot check capability flags.\n");
-      return -1;
+      return EXIT_FAILURE;
     }
     if (capfv != CAP_SET) {
       fprintf(stderr, "CRITICAL: Capability CAP_DAC_READ_SEARCH is not set, this capability is required.\n");
       cap_free(caps);
-      return -1;
+      return EXIT_FAILURE;
     }
     if (cap_get_flag(caps, CAP_SYS_PTRACE, CAP_EFFECTIVE, &capfv) != 0) {
       fprintf(stderr, "CRITICAL: Cannot check capability flags.\n");
-      return -1;
+      return EXIT_FAILURE;
     }
     if (capfv != CAP_SET) {
       fprintf(stderr, "CRITICAL: Capability CAP_SYS_PTRACE is not set, this capability is required.\n");
       cap_free(caps);
-      return -1;
+      return EXIT_FAILURE;
     }
     cap_free(caps);
   }
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
   pthread_mutex_destroy(&exit_mutex);
 
   free(evdev_path);
-  return 0;
+  return EXIT_SUCCESS;
 
 bail_out_3:
   pthread_join(win_event_loop, NULL); 
@@ -125,5 +125,5 @@ bail_out_2:
   pthread_mutex_destroy(&exit_mutex);
 bail_out_1:
   free(evdev_path);
-  return -1;
+  return EXIT_FAILURE;
 }