Remove nonstandard <err.h>.

This provides some really nice functions, but does not exist in some
environments (particularly MinGW).
This commit is contained in:
Anthony J. Bentley
2011-12-02 01:23:23 -07:00
parent b1a2c664a9
commit 5d6559f15f
12 changed files with 315 additions and 167 deletions

View File

@@ -1,4 +1,3 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -20,8 +19,11 @@ SetMapfileName(char *name)
{
mf = fopen(name, "w");
if (mf == NULL)
err(1, "Cannot open mapfile '%s'", name);
if (mf == NULL) {
fprintf(stderr, "Cannot open mapfile '%s': ", name);
perror(NULL);
exit(1);
}
}
void
@@ -29,8 +31,10 @@ SetSymfileName(char *name)
{
sf = fopen(name, "w");
if (sf == NULL)
errx(1, "Cannot open symfile '%s'", name);
if (sf == NULL) {
fprintf(stderr, "Cannot open symfile '%s'\n", name);
exit(1);
}
fprintf(sf, ";File generated by xLink v" LINK_VERSION "\n\n");
}