~ubuntu-branches/ubuntu/precise/xdm/precise

« back to all changes in this revision

Viewing changes to debian/patches/support_logfile_rotation.diff

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2008-10-05 20:55:43 UTC
  • mfrom: (7.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081005205543-t9lgih96kbj1eidd
Tags: 1:1.1.8-5
Updated Polish debconf translation, thanks to Łukasz Paździora
(closes: #499073).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# Parent  4403c371616cc416a83156451f1afd293aff0e16
5
5
Applied 099x_xdm_support_logfile_rotation.diff
6
6
 
7
 
diff -r 4403c371616c -r 24626b4361c5 dm.c
8
 
--- a/dm.c      Fri Jan  6 08:12:03 2006
9
 
+++ b/dm.c      Fri Jan  6 08:16:14 2006
10
 
@@ -81,8 +81,10 @@
 
7
--- xdm.orig/dm.c
 
8
+++ xdm/dm.c
 
9
@@ -84,8 +84,10 @@
11
10
 extern FILE    *fdopen();
12
11
 #endif
13
12
 
14
13
-static SIGVAL  StopAll (int n), RescanNotify (int n);
15
 
+static SIGVAL  StopAll (int n), RescanNotify (int n), 
 
14
+static SIGVAL  StopAll (int n), RescanNotify (int n),
16
15
+                               ReopenLogFileNotify (int n);
17
16
 static void    RescanServers (void);
18
17
+static void ReopenLogFile (void);
19
18
 static void    RestartDisplay (struct display *d, int forceReserver);
20
19
 static void    ScanServers (void);
21
20
 static void    SetAccessFileTime (void);
22
 
@@ -91,6 +93,7 @@
23
 
 static void    TerminateProcess (int pid, int signal);
 
21
@@ -94,6 +96,7 @@
 
22
 static void    TerminateProcess (pid_t pid, int signal);
24
23
 
25
24
 volatile int   Rescan;
26
25
+volatile int   Reopen;
27
26
 static long    ServersModTime, ConfigModTime, AccessFileModTime;
28
27
 
29
28
 int nofork_session = 0;
30
 
@@ -206,6 +209,7 @@
 
29
@@ -210,6 +213,7 @@
31
30
     AddOtherEntropy();
32
31
 #endif
33
32
     (void) Signal (SIGHUP, RescanNotify);
35
34
 #ifndef UNRELIABLE_SIGNALS
36
35
     (void) Signal (SIGCHLD, ChildNotify);
37
36
 #endif
38
 
@@ -216,6 +220,11 @@
 
37
@@ -220,6 +224,11 @@
39
38
 #endif
40
39
           AnyDisplaysLeft ())
41
40
     {
47
46
        if (Rescan)
48
47
        {
49
48
            RescanServers ();
50
 
@@ -240,11 +249,32 @@
 
49
@@ -244,6 +253,7 @@
51
50
     int olderrno = errno;
52
51
 
53
 
     Debug ("caught SIGHUP\n");
 
52
     Debug ("Caught SIGHUP\n");
54
53
+       Reopen = 1;
55
54
     Rescan = 1;
56
55
 #ifdef SIGNALS_RESET_WHEN_CAUGHT
57
56
     (void) Signal (SIGHUP, RescanNotify);
58
 
 #endif
 
57
@@ -251,6 +261,26 @@
59
58
     errno = olderrno;
60
 
+}
61
 
+
 
59
 }
 
60
 
62
61
+/*
63
62
+ * Handle a SIGUSR2: set variable that will instruct the main loop to
64
63
+ * reopen the log file.
77
76
+    (void) Signal (SIGUSR2, ReopenLogFileNotify);
78
77
+    errno = olderrno;
79
78
+#endif
 
79
+}
 
80
+
 
81
 static void
 
82
 ScanServers (void)
 
83
 {
 
84
@@ -318,6 +348,14 @@
80
85
 }
81
86
 
82
87
 static void
83
 
@@ -311,6 +341,14 @@
84
 
     UpdateListenSockets ();
85
 
 #endif
86
 
     StartDisplays ();
87
 
+}
88
 
+
89
 
+static void
90
88
+ReopenLogFile (void)
91
89
+{
92
90
+    Debug ("closing standard error file descriptor %d\n", STDERR_FILENO);
93
91
+    close (STDERR_FILENO);
94
92
+    InitErrorLog ();
95
 
 }
96
 
 
97
 
 static void
98
 
diff -r 4403c371616c -r 24626b4361c5 dm_error.h
99
 
--- a/dm_error.h        Fri Jan  6 08:12:03 2006
100
 
+++ b/dm_error.h        Fri Jan  6 08:16:14 2006
 
93
+}
 
94
+
 
95
+static void
 
96
 SetConfigFileTime (void)
 
97
 {
 
98
     struct stat        statb;
 
99
--- xdm.orig/dm_error.h
 
100
+++ xdm/dm_error.h
101
101
@@ -44,6 +44,8 @@
102
102
 # define GCC_PRINTFLIKE(fmt,var) /*nothing*/
103
103
 #endif
107
107
 extern void Debug        (char * fmt, ...) GCC_PRINTFLIKE(1,2);
108
108
 extern void InitErrorLog (void);
109
109
 extern void LogError     (char * fmt, ...) GCC_PRINTFLIKE(1,2);
110
 
diff -r 4403c371616c -r 24626b4361c5 error.c
111
 
--- a/error.c   Fri Jan  6 08:12:03 2006
112
 
+++ b/error.c   Fri Jan  6 08:16:14 2006
113
 
@@ -48,8 +48,6 @@
114
 
 
 
110
--- xdm.orig/error.c
 
111
+++ xdm/error.c
 
112
@@ -49,8 +49,6 @@
115
113
 #include "dm.h"
116
114
 #include "dm_error.h"
 
115
 
 
116
-#define WRITES(fd, buf) write(fd, buf, strlen(buf))
117
117
-
118
 
-#define WRITES(fd, buf) write(fd, buf, strlen(buf))
119
 
 
120
118
 void
121
119
 LogInfo(char * fmt, ...)
122
 
diff -r 4403c371616c -r 24626b4361c5 xdm.man.cpp
123
 
--- a/xdm.man.cpp       Fri Jan  6 08:12:03 2006
124
 
+++ b/xdm.man.cpp       Fri Jan  6 08:16:14 2006
125
 
@@ -1341,6 +1341,37 @@
 
120
 {
 
121
--- xdm.orig/xdm.man.cpp
 
122
+++ xdm/xdm.man.cpp
 
123
@@ -1413,6 +1413,37 @@
126
124
 multiple window systems on the same hardware, you'll probably be more
127
125
 interested in
128
126
 .I xinit.