On Fri, Sep 04, 2009 at 07:08:06PM +0200, Jim Meyering wrote:
>From 7a2202539b6445017c420644e5327ce64eaf3bac Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 4 Sep 2009 17:27:34 +0200
Subject: [PATCH 1/2] domain_conf.c: remove two dead stores
* src/domain_conf.c (virDomainSaveXML): Remove use and decl of "err".
(virDomainDefParseXML): Likewise.
---
src/domain_conf.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/domain_conf.c b/src/domain_conf.c
index 8dde5dd..050cf50 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -2520,8 +2520,7 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
/* Extract domain uuid */
tmp = virXPathString(conn, "string(./uuid[1])", ctxt);
if (!tmp) {
- int err;
- if ((err = virUUIDGenerate(def->uuid))) {
+ if (virUUIDGenerate(def->uuid)) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
"%s", _("Failed to generate
UUID"));
goto error;
@@ -4456,12 +4455,11 @@ int virDomainSaveXML(virConnectPtr conn,
char *configFile = NULL;
int fd = -1, ret = -1;
size_t towrite;
- int err;
if ((configFile = virDomainConfigFile(conn, configDir, def->name)) == NULL)
goto cleanup;
- if ((err = virFileMakePath(configDir))) {
+ if (virFileMakePath(configDir)) {
virReportSystemError(conn, errno,
_("cannot create config directory
'%s'"),
configDir);
--
1.6.4.2.409.g85dc3
>From 89e2837b4382690e4d434c086541da1dcd3d4c58 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 4 Sep 2009 18:53:20 +0200
Subject: [PATCH 2/2] util.c: avoid dead store to "flag"
* src/util.c (virExecDaemonize): Change flag |= VAR to "flag | VAR".
---
src/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util.c b/src/util.c
index 2529837..af50028 100644
--- a/src/util.c
+++ b/src/util.c
@@ -663,7 +663,7 @@ int virExecDaemonize(virConnectPtr conn,
ret = virExecWithHook(conn, argv, envp, keepfd, retpid,
infd, outfd, errfd,
- flags |= VIR_EXEC_DAEMON,
+ flags | VIR_EXEC_DAEMON,
hook, data, pidfile);
/* __virExec should have set an error */
--
1.6.4.2.409.g85dc3
Ah, right, all fine, ACK !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/