1
0
mirror of https://github.com/simh/simh.git synced 2026-01-27 04:22:24 +00:00

All: Convert from C runtime library perror() to sim_perror so that all messages will arrive in the same place(s).

This commit is contained in:
Mark Pizzolato
2015-04-03 19:56:37 -07:00
parent f2ca388f9c
commit 41978eca80
57 changed files with 94 additions and 88 deletions

7
scp.c
View File

@@ -5272,7 +5272,7 @@ if (uptr->flags & UNIT_BUF) {
rewind (uptr->fileref);
sim_fwrite (uptr->filebuf, SZ_D (dptr), cap, uptr->fileref);
if (ferror (uptr->fileref))
perror ("I/O error");
sim_printf ("%s: I/O error - %s", sim_dname (dptr), strerror (errno));
}
if (uptr->flags & UNIT_MUSTBUF) { /* dyn alloc? */
free (uptr->filebuf); /* free buf */
@@ -9581,6 +9581,11 @@ if (buf != stackbuf)
free (buf);
}
void sim_perror (const char *msg)
{
sim_printf ("%s: %s\n", msg, strerror (errno));
}
/* Print command result message to stdout, sim_log (if enabled) and sim_deb (if enabled) */
t_stat sim_messagef (t_stat stat, const char* fmt, ...)
{