diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c index c83eb02a0b8e57..d4db4349d4de7a 100644 --- a/usr.bin/leave/leave.c +++ b/usr.bin/leave/leave.c @@ -29,8 +29,8 @@ * SUCH DAMAGE. */ -#include #include +#include #include #include #include @@ -66,7 +66,7 @@ main(int argc, char **argv) (void)write(STDOUT_FILENO, MSG1, sizeof(MSG1) - 1); cp = fgets(buf, sizeof(buf), stdin); if (cp == NULL || *cp == '\n') - exit(0); + exit(EXIT_SUCCESS); } else if (argc > 2) usage(); else @@ -117,7 +117,7 @@ main(int argc, char **argv) secs -= now % 60; /* truncate (now + secs) to min */ } doalarm(secs); - exit(0); + exit(EXIT_SUCCESS); } void @@ -133,7 +133,7 @@ doalarm(u_int secs) daytime += secs; strftime(tb, sizeof(tb), "%+", localtime(&daytime)); printf("Alarm set for %s. (pid %d)\n", tb, pid); - exit(0); + exit(EXIT_SUCCESS); } sleep((u_int)2); /* let parent print set message */ if (secs >= 2) @@ -148,7 +148,7 @@ doalarm(u_int secs) if (secs >= FIVEMIN) { sleep(secs - FIVEMIN); if (write(STDOUT_FILENO, MSG2, sizeof(MSG2) - 1) != sizeof(MSG2) - 1) - exit(0); + exit(EXIT_SUCCESS); secs = FIVEMIN; } @@ -157,24 +157,24 @@ doalarm(u_int secs) if (secs >= ONEMIN) { sleep(secs - ONEMIN); if (write(STDOUT_FILENO, MSG3, sizeof(MSG3) - 1) != sizeof(MSG3) - 1) - exit(0); + exit(EXIT_SUCCESS); } #define MSG4 "\07\07Time to leave!\n" for (bother = 10; bother--;) { sleep((u_int)ONEMIN); if (write(STDOUT_FILENO, MSG4, sizeof(MSG4) - 1) != sizeof(MSG4) - 1) - exit(0); + exit(EXIT_SUCCESS); } #define MSG5 "\07\07That was the last time I'll tell you. Bye.\n" (void)write(STDOUT_FILENO, MSG5, sizeof(MSG5) - 1); - exit(0); + exit(EXIT_SUCCESS); } static void usage(void) { fprintf(stderr, "usage: leave [[+]hhmm]\n"); - exit(1); + exit(EXIT_FAILURE); }