Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 115407 | Differences between
and this patch

Collapse All | Expand All

(-)evkeyd-0.1pre7/evkeyd.c.orig (-8 / +10 lines)
Lines 16-21 Link Here
16
16
17
17
18
struct config *sigcfg;
18
struct config *sigcfg;
19
int sig_received;
19
20
20
void log_debug (struct config *cfg, char *msg)
21
void log_debug (struct config *cfg, char *msg)
21
{
22
{
Lines 124-137 Link Here
124
125
125
void signal_handler (int sig)
126
void signal_handler (int sig)
126
{
127
{
127
	if(sig == SIGTERM) {
128
	sig_received = sig;
128
		log_info(sigcfg, "recieved SIGTERM, exiting");
129
		unlink(LOCK_FILE);
130
		exit(0);
131
	} else if (sig > 32) {
132
		read_event(sigcfg, sig-32);
133
	}
134
135
}
129
}
136
130
137
int init (struct config *cfg, int argc, char **argv, 
131
int init (struct config *cfg, int argc, char **argv, 
Lines 199-205 Link Here
199
	free(verstr);
193
	free(verstr);
200
194
201
	while(1) {
195
	while(1) {
196
		sig_received = 0;
202
		sleep(1);
197
		sleep(1);
198
		if (sig_received == SIGTERM) {
199
			log_info(sigcfg, "received SIGTERM, exiting");
200
			unlink(LOCK_FILE);
201
			break;
202
		}
203
		else if (sig_received > 32)
204
			read_event(sigcfg, sig_received-32);
203
	}
205
	}
204
206
205
	finish(cfg, eventfd, pmufd);
207
	finish(cfg, eventfd, pmufd);

Return to bug 115407