From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fB5L1-00043y-Mp for qemu-devel@nongnu.org; Tue, 24 Apr 2018 17:19:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fB5L0-0005NK-AN for qemu-devel@nongnu.org; Tue, 24 Apr 2018 17:18:59 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:40893) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fB5L0-0005Mw-2Z for qemu-devel@nongnu.org; Tue, 24 Apr 2018 17:18:58 -0400 Received: by mail-lf0-x243.google.com with SMTP id j16-v6so5180317lfb.7 for ; Tue, 24 Apr 2018 14:18:57 -0700 (PDT) MIME-Version: 1.0 Sender: alistair23@gmail.com In-Reply-To: <1524592709-6553-16-git-send-email-ian.jackson@eu.citrix.com> References: <1524592709-6553-1-git-send-email-ian.jackson@eu.citrix.com> <1524592709-6553-16-git-send-email-ian.jackson@eu.citrix.com> From: Alistair Francis Date: Tue, 24 Apr 2018 14:18:25 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Xen-devel] [PATCH 15/16] os-posix: cleanup: Replace perror with error_report List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Jackson Cc: "qemu-devel@nongnu.org Developers" , Juergen Gross , Stefano Stabellini , "Daniel P. Berrange" , Michael Tokarev , Markus Armbruster , Alistair Francis , Ross Lagerwall , Paolo Bonzini , Anthony PERARD , "open list:X86" On Tue, Apr 24, 2018 at 10:58 AM, Ian Jackson w= rote: > perror() is defined to fprintf(stderr,...). HACKING says > fprintf(stderr,...) is wrong. So perror() is too. > > Signed-off-by: Ian Jackson > CC: Paolo Bonzini > CC: Markus Armbruster > CC: Daniel P. Berrange > CC: Michael Tokarev > CC: Alistair Francis > Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Alistair > --- > 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 a2ba50d..24eb700 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 =3D qemu_open("/dev/null", O_RDWR)); > @@ -383,7 +383,7 @@ int os_mlock(void) > > ret =3D mlockall(MCL_CURRENT | MCL_FUTURE); > if (ret < 0) { > - perror("mlockall"); > + error_report("mlockall: %s", strerror(errno)); > } > > return ret; > -- > 2.1.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xenproject.org > https://lists.xenproject.org/mailman/listinfo/xen-devel