tiffdump: use EXIT_FAILURE / EXIT_SUCCESS

see #17
This commit is contained in:
Thomas Bernard 2020-03-07 15:52:38 +01:00
parent 68564877c7
commit eb6806dd64
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -56,6 +56,13 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
#include "tiffio.h" #include "tiffio.h"
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
#ifndef O_BINARY #ifndef O_BINARY
# define O_BINARY 0 # define O_BINARY 0
#endif #endif
@ -105,7 +112,7 @@ void
usage() usage()
{ {
fprintf(stderr, "usage: %s [-h] [-o offset] [-m maxitems] file.tif ...\n", appname); fprintf(stderr, "usage: %s [-h] [-o offset] [-m maxitems] file.tif ...\n", appname);
exit(-1); exit(EXIT_FAILURE);
} }
int int
@ -142,7 +149,7 @@ main(int argc, char* argv[])
fd = open(argv[optind], O_RDONLY|O_BINARY, 0); fd = open(argv[optind], O_RDONLY|O_BINARY, 0);
if (fd < 0) { if (fd < 0) {
perror(argv[0]); perror(argv[0]);
return (-1); return (EXIT_FAILURE);
} }
if (multiplefiles) if (multiplefiles)
printf("%s:\n", argv[optind]); printf("%s:\n", argv[optind]);
@ -152,7 +159,7 @@ main(int argc, char* argv[])
dump(fd, diroff); dump(fd, diroff);
close(fd); close(fd);
} }
return (0); return (EXIT_SUCCESS);
} }
#define ord(e) ((int)e) #define ord(e) ((int)e)
@ -874,7 +881,7 @@ Fatal(const char* fmt, ...)
va_start(ap, fmt); va_start(ap, fmt);
vError(stderr, fmt, ap); vError(stderr, fmt, ap);
va_end(ap); va_end(ap);
exit(-1); exit(EXIT_FAILURE);
} }
/* vim: set ts=8 sts=8 sw=8 noet: */ /* vim: set ts=8 sts=8 sw=8 noet: */