Merge branch 'nosysexits'

This commit is contained in:
Emma Tebibyte 2023-12-25 19:04:44 -07:00
commit 74d5b65f78
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270
5 changed files with 15 additions and 8 deletions

View File

@ -18,9 +18,9 @@
#include <errno.h> /* errno */ #include <errno.h> /* errno */
#include <stdio.h> /* fprintf(3), stderr */ #include <stdio.h> /* fprintf(3), stderr */
#include <stdlib.h> /* strtol(3), size_t */ #include <stdlib.h> /* strtol(3), size_t, EXIT_FAILURE */
#ifndef EX_USAGE #ifndef EX_USAGE
# include <sysexits.h> /* EX_USAGE */ # define EX_USAGE EXIT_FAILURE
#endif #endif
#include <unistd.h> /* getopt(3), optind */ #include <unistd.h> /* getopt(3), optind */

View File

@ -18,9 +18,13 @@
#include <stdio.h> /* fprintf(3), fputs(3), getc(3), putc(3), stdin, stdout, #include <stdio.h> /* fprintf(3), fputs(3), getc(3), putc(3), stdin, stdout,
* EOF */ * EOF */
#include <stdlib.h> /* EXIT_FAILURE, EXIT_SUCCESS */
#include <unistd.h> /* getopt(3) */ #include <unistd.h> /* getopt(3) */
#if !defined EX_USAGE || !defined EX_OK #if !defined EX_USAGE
# include <sysexits.h> # define EX_USAGE EXIT_FAILURE
#endif
#if !defined EX_OK
# define EX_OK EXIT_SUCCESS
#endif #endif
int main(int argc, char *argv[]){ int main(int argc, char *argv[]){

View File

@ -17,9 +17,10 @@
*/ */
#include <stdio.h> /* fprintf(3), stderr, NULL */ #include <stdio.h> /* fprintf(3), stderr, NULL */
#include <stdlib.h> /* EXIT_FAILURE */
#include <string.h> /* strchr(3) */ #include <string.h> /* strchr(3) */
#ifndef EX_USAGE #ifndef EX_USAGE
# include <sysexits.h> # define EX_USAGE EXIT_FAILURE
#endif #endif
#include <unistd.h> /* access(3), getopt(3), F_OK, R_OK, W_OK, X_OK */ #include <unistd.h> /* access(3), getopt(3), F_OK, R_OK, W_OK, X_OK */
#include <sys/stat.h> /* lstat(3), stat struct, S_ISBLK, S_ISCHR, S_ISDIR, #include <sys/stat.h> /* lstat(3), stat struct, S_ISBLK, S_ISCHR, S_ISDIR,

View File

@ -20,9 +20,10 @@
#include <ctype.h> #include <ctype.h>
#include <stddef.h> /* NULL */ #include <stddef.h> /* NULL */
#include <stdio.h> /* fprintf(3) */ #include <stdio.h> /* fprintf(3) */
#include <stdlib.h> /* EXIT_FAILURE */
#include <string.h> /* strcmp(3) */ #include <string.h> /* strcmp(3) */
#if !defined EX_USAGE #if !defined EX_USAGE
# include <sysexits.h> # define EX_USAGE EXIT_FAILURE
#endif #endif
static char *program_name = "str"; static char *program_name = "str";

View File

@ -1,6 +1,7 @@
#include <stdio.h> /* fprintf(3), stderr */ #include <stdio.h> /* fprintf(3), stderr */
#ifndef EX_USAGE #include <stdlib.h> /* EXIT_FAILURE */
# include <sysexits.h> /* EX_USAGE */ #if !defined EX_USAGE
# define EX_USAGE EXIT_FAILURE
#endif #endif
static char *program_name = "strcmp"; static char *program_name = "strcmp";