mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-25 12:32:07 +00:00
rgblink: improve file open error messages
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
|
||||
#include "asmotor.h"
|
||||
|
||||
@@ -19,8 +21,9 @@ SetMapfileName(char *name)
|
||||
{
|
||||
mf = fopen(name, "w");
|
||||
|
||||
if (!mf)
|
||||
errx(5, "Unable to open mapfile for writing");
|
||||
if (mf == NULL)
|
||||
errx(EX_CANTCREAT, "Cannot open mapfile '%s' : %s", name,
|
||||
strerror(errno));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -28,8 +31,9 @@ SetSymfileName(char *name)
|
||||
{
|
||||
sf = fopen(name, "w");
|
||||
|
||||
if (!sf)
|
||||
errx(5, "Unable to open symfile for writing");
|
||||
if (sf == NULL)
|
||||
errx(EX_CANTCREAT, "Cannot open symfile '%' : %s", name,
|
||||
strerror(errno));
|
||||
|
||||
fprintf(sf, ";File generated by xLink v" LINK_VERSION "\n\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user