]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidd: add debug message for timeout
authorKarel Zak <kzak@redhat.com>
Fri, 9 Oct 2015 09:46:49 +0000 (11:46 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 9 Oct 2015 09:46:49 +0000 (11:46 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/uuidd.c

index 4e9eb53cdeafb503be9789035ec7903be54e4f08..4b5bf00e98df91c8f550cf96f40275b9f378f991 100644 (file)
@@ -324,7 +324,7 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
        int                     s = 0;
        int                     fd_pidfile = -1;
        int                     ret;
-       struct pollfd           pfd[2];
+       struct pollfd           pfd[2];
        sigset_t                sigmask;
        int                     sigfd;
        enum {
@@ -421,8 +421,11 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
                        warn(_("poll failed"));
                                all_done(uuidd_cxt, EXIT_FAILURE);
                }
-               if (ret == 0)           /* truen when poll() times out */
+               if (ret == 0) {         /* truen when poll() times out */
+                       if (uuidd_cxt->debug)
+                               fprintf(stderr, _("timeout [%d sec]\n"), uuidd_cxt->timeout),
                        all_done(uuidd_cxt, EXIT_SUCCESS);
+               }
                if (pfd[POLLFD_SIGNAL].revents != 0)
                        handle_signal(uuidd_cxt, sigfd);
                if (pfd[POLLFD_SOCKET].revents == 0)