[PATCH 1/6] nss: Promote debug message to proper error when time() fails

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

 



From: Michal Privoznik <mprivozn@xxxxxxxxxx>

The difference between DEBUG() and ERROR() macros is that the
latter also prints (stringified) errno. Inside of findLease()
there's one line where time() is called which is documented as:

  On error, ((time_t) -1) is returned, and errno is set to
  indicate the error.

Therefore, don't just print DEBUG() but ERROR() so that the cause
for the error is printed too.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tools/nss/libvirt_nss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c
index 6ee328a8df..52b769d760 100644
--- a/tools/nss/libvirt_nss.c
+++ b/tools/nss/libvirt_nss.c
@@ -174,7 +174,7 @@ findLease(const char *name,
 #endif
 
     if ((now = time(NULL)) == (time_t)-1) {
-        DEBUG("Failed to get time");
+        ERROR("Failed to get time");
         goto cleanup;
     }
 
-- 
2.49.0




[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]

  Powered by Linux