[PATCH] logging: avoid variables called 'daemon' due to function clash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With some versions of GLibC / GCC, a variable called 'daemon'
will result in a warning about clashing with the function also
named 'daemon'. Rename it to 'dmn' to avoid the clash.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---

Pushed as a broken build fix.

 src/logging/log_daemon.c | 10 +++++-----
 src/logging/log_daemon.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 3fda9ca..6da5876 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -127,12 +127,12 @@ virLogDaemonFree(virLogDaemonPtr logd)
 static void
 virLogDaemonInhibitor(bool inhibit, void *opaque)
 {
-    virLogDaemonPtr daemon = opaque;
+    virLogDaemonPtr dmn = opaque;
 
     if (inhibit)
-        virNetDaemonAddShutdownInhibition(daemon->dmn);
+        virNetDaemonAddShutdownInhibition(dmn->dmn);
     else
-        virNetDaemonRemoveShutdownInhibition(daemon->dmn);
+        virNetDaemonRemoveShutdownInhibition(dmn->dmn);
 }
 
 static virLogDaemonPtr
@@ -177,9 +177,9 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged)
 
 
 virLogHandlerPtr
-virLogDaemonGetHandler(virLogDaemonPtr daemon)
+virLogDaemonGetHandler(virLogDaemonPtr dmn)
 {
-    return daemon->handler;
+    return dmn->handler;
 }
 
 
diff --git a/src/logging/log_daemon.h b/src/logging/log_daemon.h
index b076a4f..8d55bb2 100644
--- a/src/logging/log_daemon.h
+++ b/src/logging/log_daemon.h
@@ -40,6 +40,6 @@ struct _virLogDaemonClient {
 
 extern virLogDaemonPtr logDaemon;
 
-virLogHandlerPtr virLogDaemonGetHandler(virLogDaemonPtr daemon);
+virLogHandlerPtr virLogDaemonGetHandler(virLogDaemonPtr dmn);
 
 #endif /* __VIR_LOG_DAEMON_H__ */
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]