[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_
From: |
Ian Jackson |
Subject: |
[Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report |
Date: |
Thu, 19 Apr 2018 17:45:18 +0100 |
perror() is defined to fprintf(stderr,...). HACKING says
fprintf(stderr,...) is wrong. So perror() is too.
Signed-off-by: Ian Jackson <address@hidden>
CC: Paolo Bonzini <address@hidden>
CC: Markus Armbruster <address@hidden>
CC: Daniel P. Berrange <address@hidden>
CC: Michael Tokarev <address@hidden>
CC: Alistair Francis <address@hidden>
---
v7: New patch
---
os-posix.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/os-posix.c b/os-posix.c
index d4cf466..0108028 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -125,7 +125,7 @@ void os_set_proc_name(const char *s)
/* Could rewrite argv[0] too, but that's a bit more complicated.
This simple way is enough for `top'. */
if (prctl(PR_SET_NAME, name)) {
- perror("unable to change process name");
+ error_report("unable to change process name: %s", strerror(errno));
exit(1);
}
#else
@@ -247,7 +247,7 @@ static void change_root(void)
exit(1);
}
if (chdir("/")) {
- perror("not able to chdir to /");
+ error_report("not able to chdir to /: %s", strerror(errno));
exit(1);
}
}
@@ -309,7 +309,7 @@ void os_setup_post(void)
if (daemonize) {
if (chdir("/")) {
- perror("not able to chdir to /");
+ error_report("not able to chdir to /: %s", strerror(errno));
exit(1);
}
TFR(fd = qemu_open("/dev/null", O_RDWR));
@@ -383,7 +383,7 @@ int os_mlock(void)
ret = mlockall(MCL_CURRENT | MCL_FUTURE);
if (ret < 0) {
- perror("mlockall");
+ error_report("mlockall: %s", strerror(errno));
}
return ret;
--
2.1.4
- [Qemu-devel] [PATCH 09/16] os-posix: cleanup: Replace fprintfs with error_report in change_process_uid, (continued)
- [Qemu-devel] [PATCH 09/16] os-posix: cleanup: Replace fprintfs with error_report in change_process_uid, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 14/16] os-posix: cleanup: Replace fprintf with error_report in remaining call sites, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 10/16] os-posix: Provide new -runas <uid>:<gid> facility, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 11/16] xen: Use newly added dmops for mapping VGA memory, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 02/16] AccelClass: Introduce accel_setup_post, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 12/16] xen: Remove now-obsolete xen_xc_domain_add_to_physmap, Ian Jackson, 2018/04/19
- [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report,
Ian Jackson <=
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Philippe Mathieu-Daudé, 2018/04/19
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Ian Jackson, 2018/04/24
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Daniel P . Berrangé, 2018/04/24
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Eric Blake, 2018/04/24
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Eric Blake, 2018/04/24
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Daniel P . Berrangé, 2018/04/24
- Re: [Qemu-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report, Markus Armbruster, 2018/04/24
[Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash, Ian Jackson, 2018/04/19