Revert use of system exit codes.

While well‐intentioned, in practice this hurts portability and
really, nobody checks the return codes anyway.
This commit is contained in:
Anthony J. Bentley
2011-06-04 21:33:03 -06:00
parent d784b14615
commit b1a2c664a9
6 changed files with 16 additions and 22 deletions

View File

@@ -2,7 +2,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
#include "asmotor.h"
@@ -40,7 +39,7 @@ usage(void)
printf("usage: rgblink [-t] [-l library] [-m mapfile] [-n symfile] [-o outfile]\n");
printf("\t [-s symbol] [-z pad_value] objectfile [...]\n");
exit(EX_USAGE);
exit(1);
}
/*
@@ -74,9 +73,9 @@ main(int argc, char *argv[])
case 'p':
fillchar = strtoul(optarg, &ep, 0);
if (optarg[0] == '\0' || *ep != '\0')
errx(EX_USAGE, "Invalid argument for option 'p'");
errx(1, "Invalid argument for option 'p'");
if (fillchar < 0 || fillchar > 0xFF)
errx(EX_USAGE, "Argument for option 'p' must be between 0 and 0xFF");
errx(1, "Argument for option 'p' must be between 0 and 0xFF");
break;
case 's':
options |= OPT_SMART_C_LINK;

View File

@@ -3,7 +3,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include "asmotor.h"
@@ -22,7 +21,7 @@ SetMapfileName(char *name)
mf = fopen(name, "w");
if (mf == NULL)
err(EX_CANTCREAT, "Cannot open mapfile '%s'", name);
err(1, "Cannot open mapfile '%s'", name);
}
void
@@ -31,7 +30,7 @@ SetSymfileName(char *name)
sf = fopen(name, "w");
if (sf == NULL)
errx(EX_CANTCREAT, "Cannot open symfile '%s'", name);
errx(1, "Cannot open symfile '%s'", name);
fprintf(sf, ";File generated by xLink v" LINK_VERSION "\n\n");
}

View File

@@ -8,7 +8,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include "link/mylink.h"
#include "link/main.h"
@@ -446,7 +445,7 @@ obj_Readfile(char *tzObjectfile)
pObjfile = fopen(tzObjectfile, "rb");
if (pObjfile == NULL)
err(EX_NOINPUT, "Unable to open object '%s'",
err(1, "Unable to open object '%s'",
tzObjectfile);
obj_ReadOpenFile(pObjfile, tzObjectfile);
fclose(pObjfile);
@@ -496,7 +495,7 @@ lib_Readfile(char *tzLibfile)
pObjfile = fopen(tzLibfile, "rb");
if (pObjfile == NULL)
err(EX_NOINPUT, "Unable to open object '%s'", tzLibfile);
err(1, "Unable to open object '%s'", tzLibfile);
if (!pObjfile) {
errx(5, "Unable to open '%s'", tzLibfile);
}