qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	qemu-trivial@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] util/error: Remove unnecessary saved_errno
Date: Sat,  2 Mar 2019 23:38:25 +0100	[thread overview]
Message-ID: <20190302223825.11192-3-philmd@redhat.com> (raw)
In-Reply-To: <20190302223825.11192-1-philmd@redhat.com>

Since 552375088a8, error_set_errno() calls error_setv() which
already protect errno for clobbering.
Remove the now unnecessary saved_errno.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 util/error.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/util/error.c b/util/error.c
index 934a78e1b1..0402fa1b9d 100644
--- a/util/error.c
+++ b/util/error.c
@@ -101,14 +101,11 @@ void error_setg_errno_internal(Error **errp,
                                int os_errno, const char *fmt, ...)
 {
     va_list ap;
-    int saved_errno = errno;
 
     va_start(ap, fmt);
     error_setv(errp, src, line, func, ERROR_CLASS_GENERIC_ERROR, fmt, ap,
                os_errno != 0 ? strerror(os_errno) : NULL);
     va_end(ap);
-
-    errno = saved_errno;
 }
 
 void error_setg_file_open_internal(Error **errp,
-- 
2.20.1

  parent reply	other threads:[~2019-03-02 22:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02 22:38 [Qemu-devel] [PATCH 0/2] util/error: Trivial cleanup Philippe Mathieu-Daudé
2019-03-02 22:38 ` [Qemu-devel] [PATCH 1/2] util/error: Remove an unnecessary NULL check Philippe Mathieu-Daudé
2019-03-02 22:38 ` Philippe Mathieu-Daudé [this message]
2019-03-03  1:12   ` [Qemu-devel] [PATCH 2/2] util/error: Remove unnecessary saved_errno Eric Blake
2019-03-03  2:00     ` Philippe Mathieu-Daudé
2019-03-04 15:36 ` [Qemu-devel] [PATCH 0/2] util/error: Trivial cleanup Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190302223825.11192-3-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).