summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd/loadfile_elf.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2015-11-23 13:04:50 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2015-11-23 13:04:50 +0000
commit4e11e311495bdc25503c0a0c31d6b07af9bb1a4b (patch)
tree8d0899a73e36a82d1303913d2d10e016b1643577 /usr.sbin/vmd/loadfile_elf.c
parent57148cf533ab346dc20bec5a7b3593e6a7c2f3f7 (diff)
Add support for logging to stderr or syslog, and to run vmd in
foreground with -d. OK mlarkin@ jung@
Diffstat (limited to 'usr.sbin/vmd/loadfile_elf.c')
-rw-r--r--usr.sbin/vmd/loadfile_elf.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/vmd/loadfile_elf.c b/usr.sbin/vmd/loadfile_elf.c
index df566c4f2db..29e88de556c 100644
--- a/usr.sbin/vmd/loadfile_elf.c
+++ b/usr.sbin/vmd/loadfile_elf.c
@@ -1,5 +1,5 @@
/* $NetBSD: loadfile.c,v 1.10 2000/12/03 02:53:04 tsutsui Exp $ */
-/* $OpenBSD: loadfile_elf.c,v 1.1 2015/11/22 20:20:32 mlarkin Exp $ */
+/* $OpenBSD: loadfile_elf.c,v 1.2 2015/11/23 13:04:49 reyk Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -382,8 +382,7 @@ mread(int fd, uint32_t addr, size_t sz)
ct = sz;
if (read(fd, buf, ct) != ct) {
- fprintf(stderr, "%s: error %d in mread (%s)\n\r",
- __progname, errno, strerror(errno));
+ log_warn("%s: error %d in mread", __progname, errno);
return (0);
}
rd += ct;
@@ -407,8 +406,7 @@ mread(int fd, uint32_t addr, size_t sz)
ct = PAGE_SIZE;
if (read(fd, buf, ct) != ct) {
- fprintf(stderr, "%s: error %d in mread (%s)\n\r",
- __progname, errno, strerror(errno));
+ log_warn("%s: error %d in mread", __progname, errno);
return (0);
}
rd += ct;
@@ -534,8 +532,7 @@ mbzero(uint32_t addr, int sz)
static void
mbcopy(char *src, char *dst, int sz)
{
- fprintf(stderr, "warning: bcopy during ELF kernel load not "
- "supported\n\r");
+ log_warnx("warning: bcopy during ELF kernel load not supported");
}
/*