use macros for exit codes

Tue, 23 Aug 2016 12:06:46 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 23 Aug 2016 12:06:46 +0200
changeset 38
77c158821738
parent 37
1a67185e5496
child 39
ac35daceb24c

use macros for exit codes

src/c2html.c file | annotate | diff | comparison | revisions
     1.1 --- a/src/c2html.c	Tue Aug 23 12:05:41 2016 +0200
     1.2 +++ b/src/c2html.c	Tue Aug 23 12:06:46 2016 +0200
     1.3 @@ -244,7 +244,7 @@
     1.4                  break;
     1.5              case 'h':
     1.6                  printhelp();
     1.7 -                return 0;
     1.8 +                return EXIT_SUCCESS;
     1.9              case 'v':
    1.10              case 'V':
    1.11  #ifdef VERSION_DEVELOP
    1.12 @@ -252,9 +252,9 @@
    1.13  #else
    1.14                  printf("%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
    1.15  #endif
    1.16 -                return 0;
    1.17 +                return EXIT_SUCCESS;
    1.18              default:
    1.19 -                return 1;
    1.20 +                return EXIT_FAILURE;
    1.21          }
    1.22      }
    1.23  
    1.24 @@ -268,7 +268,7 @@
    1.25              fout = fopen(settings.outfilename, "w");
    1.26              if (!fout) {
    1.27                  perror("Error opening output file");
    1.28 -                return -1;
    1.29 +                return EXIT_FAILURE;
    1.30              }
    1.31          } else {
    1.32              fout = stdout;
    1.33 @@ -276,7 +276,7 @@
    1.34          
    1.35          if (copyfile(settings.headerfile, fout)) {
    1.36              perror("Error opening header file");
    1.37 -            retcode = -1;
    1.38 +            retcode = EXIT_FAILURE;
    1.39              goto prog_end;
    1.40          }
    1.41          
    1.42 @@ -308,12 +308,12 @@
    1.43              freeinputfilebuffer(inputfile);
    1.44          } else {
    1.45              perror("Error opening input file");
    1.46 -            retcode = -1;
    1.47 +            retcode = EXIT_FAILURE;
    1.48          }
    1.49          
    1.50          if (copyfile(settings.footerfile, fout)) {
    1.51              perror("Error opening footer file");
    1.52 -            retcode = -1;
    1.53 +            retcode = EXIT_FAILURE;
    1.54          }
    1.55          
    1.56          prog_end:        

mercurial