chiark / gitweb /
logger,initctl: use global exit timeout
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Apr 2011 00:32:42 +0000 (02:32 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 16 Apr 2011 00:03:34 +0000 (02:03 +0200)
src/def.h
src/initctl.c
src/logger.c

index c23cd33d8a6a2cb4bfb4e0cdf459b586d3a661c9..958d1eb79c569cde05da2f5f3a7d54950b7dfe07 100644 (file)
--- a/src/def.h
+++ b/src/def.h
@@ -27,6 +27,8 @@
 #define DEFAULT_TIMEOUT_USEC (3*USEC_PER_MINUTE)
 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
 
+#define DEFAULT_EXIT_USEC (5*USEC_PER_MINUTE)
+
 #define SYSTEMD_CGROUP_CONTROLLER "name=systemd"
 
 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
index 15da4593d0a63648d70885b480085ce6d830e761..dd743142fd10dff952f8d20c5854eca26838f412 100644 (file)
 #include "special.h"
 #include "sd-daemon.h"
 #include "dbus-common.h"
+#include "def.h"
 
 #define SERVER_FD_MAX 16
-#define TIMEOUT ((int) (10*MSEC_PER_SEC))
+#define TIMEOUT_MSEC ((int) (DEFAULT_EXIT_USEC/USEC_PER_MSEC))
 
 typedef struct Fifo Fifo;
 
@@ -388,7 +389,7 @@ int main(int argc, char *argv[]) {
 
                 if ((k = epoll_wait(server.epoll_fd,
                                     &event, 1,
-                                    TIMEOUT)) < 0) {
+                                    TIMEOUT_MSEC)) < 0) {
 
                         if (errno == EINTR)
                                 continue;
index faa6c9721f2f3752692124c9592f992ce609cba7..81196dbe00cd0e0734989d22149439bd5e040d14 100644 (file)
 #include "list.h"
 #include "sd-daemon.h"
 #include "tcpwrap.h"
+#include "def.h"
 
 #define STREAMS_MAX 4096
 #define SERVER_FD_MAX 16
-#define TIMEOUT ((int) (5*60*MSEC_PER_SEC))
+#define TIMEOUT_MSEC ((int) (DEFAULT_EXIT_USEC/USEC_PER_MSEC))
 
 typedef struct Stream Stream;
 
@@ -661,7 +662,7 @@ int main(int argc, char *argv[]) {
 
                 if ((k = epoll_wait(server.epoll_fd,
                                     &event, 1,
-                                    server.n_streams <= 0 ? TIMEOUT : -1)) < 0) {
+                                    server.n_streams <= 0 ? TIMEOUT_MSEC : -1)) < 0) {
 
                         if (errno == EINTR)
                                 continue;