Gentoo Archives: gentoo-commits

From: "Michael Januszewski (spock)" <spock@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-gfx/splashutils/files: splashutils-1.5.4.3-daemon-exit-signal.patch splashutils-1.5.4.3-openrc-effects.patch
Date: Sun, 04 Apr 2010 15:20:29
Message-Id: E1NyRcd-0001Ba-G5@stork.gentoo.org
1 spock 10/04/04 15:20:23
2
3 Added: splashutils-1.5.4.3-daemon-exit-signal.patch
4 splashutils-1.5.4.3-openrc-effects.patch
5 Log:
6 Do not enable fadeout if it's not explicitly requested, make sure all signals are processed before exiting (bug #296152).
7 (Portage version: 2.2_rc67/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-gfx/splashutils/files/splashutils-1.5.4.3-daemon-exit-signal.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-daemon-exit-signal.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-daemon-exit-signal.patch?rev=1.1&content-type=text/plain
14
15 Index: splashutils-1.5.4.3-daemon-exit-signal.patch
16 ===================================================================
17 diff --git a/core/src/daemon.c b/core/src/daemon.c
18 index e3463fc..eae23ec 100644
19 --- a/core/src/daemon.c
20 +++ b/core/src/daemon.c
21 @@ -306,6 +306,35 @@ void handler_alarm(int unused)
22 return;
23 }
24
25 +int process_switch_sig(int sig)
26 +{
27 + /* Switch from silent to verbose. */
28 + if (sig == SIGUSR1) {
29 + pthread_mutex_lock(&mtx_paint);
30 + pthread_mutex_lock(&mtx_tty);
31 + ioctl(fd_tty[config.tty_s], VT_RELDISP, 1);
32 + pthread_mutex_unlock(&mtx_tty);
33 +
34 + ctty = CTTY_VERBOSE;
35 + pthread_mutex_unlock(&mtx_paint);
36 + return 1;
37 + /* Switch back to silent. */
38 + } else if (sig == SIGUSR2) {
39 + pthread_mutex_lock(&mtx_paint);
40 + pthread_mutex_lock(&mtx_tty);
41 + ioctl(fd_tty[config.tty_s], VT_RELDISP, 2);
42 + pthread_mutex_unlock(&mtx_tty);
43 +
44 + ctty = CTTY_SILENT;
45 + pthread_mutex_unlock(&mtx_paint);
46 +
47 + switch_silent();
48 + return 2;
49 + }
50 +
51 + return 0;
52 +}
53 +
54 /*
55 * Signal handler.
56 *
57 @@ -315,7 +344,7 @@ void handler_alarm(int unused)
58 */
59 void* thf_sighandler(void *unusued)
60 {
61 - sigset_t sigset;
62 + sigset_t sigset, sigset_switch;
63 int sig;
64
65 /* We don't handle SIGALRM. */
66 @@ -329,31 +358,39 @@ void* thf_sighandler(void *unusued)
67 sigaddset(&sigset, SIGTERM);
68 sigaddset(&sigset, SIGINT);
69
70 + sigemptyset(&sigset_switch);
71 + sigaddset(&sigset_switch, SIGUSR1);
72 + sigaddset(&sigset_switch, SIGUSR2);
73 +
74 while (1) {
75 sigwait(&sigset, &sig);
76
77 - /* Switch from silent to verbose. */
78 - if (sig == SIGUSR1) {
79 - pthread_mutex_lock(&mtx_paint);
80 - pthread_mutex_lock(&mtx_tty);
81 - ioctl(fd_tty[config.tty_s], VT_RELDISP, 1);
82 - pthread_mutex_unlock(&mtx_tty);
83 -
84 - ctty = CTTY_VERBOSE;
85 - pthread_mutex_unlock(&mtx_paint);
86 - /* Switch back to silent. */
87 - } else if (sig == SIGUSR2) {
88 - pthread_mutex_lock(&mtx_paint);
89 - pthread_mutex_lock(&mtx_tty);
90 - ioctl(fd_tty[config.tty_s], VT_RELDISP, 2);
91 - pthread_mutex_unlock(&mtx_tty);
92 -
93 - ctty = CTTY_SILENT;
94 - pthread_mutex_unlock(&mtx_paint);
95 + process_switch_sig(sig);
96 +
97 + /* Internally generated terminate signal */
98 + if (sig == SIGINT) {
99 + struct timespec timeout;
100 + timeout.tv_sec = 0;
101 + timeout.tv_nsec = 0;
102 + bool pending = true;
103 +
104 + /*
105 + * Process any remaining signals. There are no guarantees as to the
106 + * order in which the signals are delivered, so we have to make sure
107 + * all pending signals are processed before exiting.
108 + */
109 + while (pending) {
110 + sig = sigtimedwait(&sigset_switch, NULL, &timeout);
111 +
112 + if (sig == -1) {
113 + /* No more pending signals. */
114 + if (errno == EAGAIN)
115 + pending = false;
116 + } else {
117 + process_switch_sig(sig);
118 + }
119 + }
120
121 - switch_silent();
122 - } else if (sig == SIGINT) {
123 - /* internally generated terminate signal */
124 do_cleanup();
125 pthread_exit(NULL);
126 } else if (sig == SIGTERM) {
127
128
129
130 1.1 media-gfx/splashutils/files/splashutils-1.5.4.3-openrc-effects.patch
131
132 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-openrc-effects.patch?rev=1.1&view=markup
133 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-gfx/splashutils/files/splashutils-1.5.4.3-openrc-effects.patch?rev=1.1&content-type=text/plain
134
135 Index: splashutils-1.5.4.3-openrc-effects.patch
136 ===================================================================
137 commit 7cf5fd02bbc6422ddbc9af7185cc47657148deb0
138 Author: Michał Januszewski <spock@g.o>
139 Date: Sun Apr 4 16:19:40 2010 +0200
140
141 gentoo: only enable the effects that are actually selected.
142
143 diff --git a/gentoo/splash.c b/gentoo/splash.c
144 index 4b9a5b9..5220571 100644
145 --- a/gentoo/splash.c
146 +++ b/gentoo/splash.c
147 @@ -660,7 +660,7 @@ static int splash_start(const char *runlevel)
148 (config->type == fbspl_reboot) ? "reboot" : ((config->type == fbspl_shutdown) ? "shutdown" : "bootup"),
149 (config->kdmode == KD_GRAPHICS) ? "--kdgraphics" : "",
150 (config->textbox_visible) ? "--textbox" : "",
151 - (config->effects & (FBSPL_EFF_FADEOUT | FBSPL_EFF_FADEIN)) ? "--effects=fadeout,fadein" :
152 + ((config->effects & (FBSPL_EFF_FADEOUT | FBSPL_EFF_FADEIN)) == (FBSPL_EFF_FADEOUT | FBSPL_EFF_FADEIN)) ? "--effects=fadeout,fadein" :
153 ((config->effects & FBSPL_EFF_FADEOUT) ? "--effects=fadeout" :
154 ((config->effects & FBSPL_EFF_FADEIN) ? "--effects=fadein" : "")));
155
156 @@ -716,11 +716,7 @@ static int splash_stop(const char *runlevel)
157
158 /* If we don't get a runlevel argument, then we're being executed
159 * because of a rc-abort event and we don't save any data. */
160 - if (runlevel == NULL) {
161 - return fbsplash_cache_cleanup(NULL);
162 - } else {
163 - return fbsplash_cache_cleanup(save);
164 - }
165 + return fbsplash_cache_cleanup(save);
166 }
167
168 int rc_plugin_hook(RC_HOOK hook, const char *name)
169
170 commit d711147fc835cf408a9a4e7432fc565a6b952183
171 Author: Michał Januszewski <spock@g.o>
172 Date: Sun Apr 4 16:57:23 2010 +0200
173
174 gentoo: add some comments in splash.conf
175
176 diff --git a/gentoo/splash.conf b/gentoo/splash.conf
177 index 4cf0a32..f056382 100644
178 --- a/gentoo/splash.conf
179 +++ b/gentoo/splash.conf
180 @@ -21,7 +21,10 @@ SPLASH_TEXTBOX="no"
181 SPLASH_AUTOVERBOSE="0"
182
183 # Name of the boot service starting X. Useful in cases when X is started
184 -# by a custom initscript, other than the usual 'xdm'.
185 +# by a custom initscript, other than the usual 'xdm'. If you are using a
186 +# custom X initscript and do not set this variable correctly, do not be
187 +# surprised if you end up at tty1 at the end of the boot process (instead of
188 +# in an X session).
189 # SPLASH_XSERVICE="xdm"
190
191 #########################################################################