mirror of https://github.com/mkerrisk/man-pages
Use symbolic constants in exit(2) calls
This commit is contained in:
parent
19dbfd0a98
commit
4c44ffe5dc
|
@ -458,7 +458,7 @@ main(int argc, char **argv)
|
|||
fprintf(stderr,
|
||||
"Usage\\n\\tfwd <listen-port> "
|
||||
"<forward-to-port> <forward-to-ip-address>\\n");
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
@ -467,7 +467,7 @@ main(int argc, char **argv)
|
|||
|
||||
h = listen_socket(atoi(argv[1]));
|
||||
if (h < 0)
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
for (;;) {
|
||||
int r, nfds = 0;
|
||||
|
@ -510,7 +510,7 @@ main(int argc, char **argv)
|
|||
continue;
|
||||
if (r < 0) {
|
||||
perror("select()");
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (FD_ISSET(h, &rd)) {
|
||||
unsigned int l;
|
||||
|
|
|
@ -377,7 +377,7 @@ main(int argc, char **argv)
|
|||
handle = dlopen("libm.so", RTLD_LAZY);
|
||||
if (!handle) {
|
||||
fprintf(stderr, "%s\en", dlerror());
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
dlerror(); /* Clear any existing error */
|
||||
|
@ -386,7 +386,7 @@ main(int argc, char **argv)
|
|||
*(void **) (&cosine) = dlsym(handle, "cos");
|
||||
if ((error = dlerror()) != NULL) {
|
||||
fprintf(stderr, "%s\en", error);
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("%f\en", (*cosine)(2.0));
|
||||
|
|
|
@ -138,7 +138,7 @@ main(void)
|
|||
.\" if (i == ENOENT)
|
||||
.\" break;
|
||||
.\" printf("getgrent_r: %s", strerror(i));
|
||||
.\" exit(1);
|
||||
.\" exit(EXIT_FAILURE);
|
||||
.\" }
|
||||
.SH "CONFORMING TO"
|
||||
These functions are GNU extensions, done in a style resembling
|
||||
|
|
|
@ -428,7 +428,7 @@ main(int argc, char **argv)
|
|||
printf("\\n");
|
||||
}
|
||||
|
||||
exit(0);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
.fi
|
||||
.SH BUGS
|
||||
|
|
|
@ -135,7 +135,7 @@ main(void)
|
|||
.\" if (i == ENOENT)
|
||||
.\" break;
|
||||
.\" printf("getpwent_r: %s", strerror(i));
|
||||
.\" exit(1);
|
||||
.\" exit(EXIT_SUCCESS);
|
||||
.\" }
|
||||
.SH "CONFORMING TO"
|
||||
These functions are GNU extensions, done in a style resembling
|
||||
|
|
|
@ -197,7 +197,7 @@ main(void)
|
|||
/* there should be no failures */
|
||||
if (ep == NULL) {
|
||||
fprintf(stderr, "entry failed\\n");
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
for (i = 22; i < 26; i++) {
|
||||
|
|
|
@ -195,7 +195,7 @@ xmalloc(unsigned n)
|
|||
if (p)
|
||||
return p;
|
||||
fprintf(stderr, "insufficient memory\\n");
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -241,7 +241,7 @@ main(void)
|
|||
*ptr = rand() & 0xff;
|
||||
val = tsearch((void *) ptr, &root, compare);
|
||||
if (val == NULL)
|
||||
exit(1);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
twalk(root, action);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue