aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rpt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/rpt.c b/rpt.c
index d6adb31..d6476ad 100644
--- a/rpt.c
+++ b/rpt.c
@@ -207,17 +207,17 @@ main(int argc, char* argv[])
break;
case 'h':
print_help();
- return 0;
+ exit(EXIT_SUCCESS);
case 'V':
print_version();
- return 0;
+ exit(EXIT_SUCCESS);
case ':':
fprintf(stderr, "rpt: COUNT value missing\n");
print_usage(stderr);
- return 1; /* invalid option */
+ exit(EXIT_INVALID_ARG);
default:
print_usage(stderr);
- return 1; /* invalid option */
+ exit(EXIT_INVALID_ARG);
}
}
@@ -230,7 +230,7 @@ main(int argc, char* argv[])
{
fprintf(stderr, "rpt: failed to convert COUNT : '%s'\n",
strcount);
- return 2;
+ exit(EXIT_INVALID_COUNT);
}
}
@@ -245,7 +245,7 @@ main(int argc, char* argv[])
if (poll(&pollfd, 1, 0) < 0)
{
perror("poll");
- return 4;
+ exit(EXIT_OTHER);
}
if (pollfd.revents & POLLIN)
@@ -256,5 +256,5 @@ main(int argc, char* argv[])
if (stdin_clone)
fclose(stdin_clone);
- return 0;
+ return EXIT_SUCCESS;
}