diff --git a/input.c b/input.c index 9176659f3..f8077f1f8 100644 --- a/input.c +++ b/input.c @@ -49,11 +49,9 @@ struct popen_noshell_pass_to_pclose pclose_arg; void slider_handler(int sig) { - int status; /* Kill lipc-wait-event properly on exit */ if(pclose_arg.pid != 0) { - status = kill(pclose_arg.pid, SIGTERM); - printf("[SIGTERM] kill returned %d\n", status); + kill(pclose_arg.pid, SIGTERM); } } @@ -77,8 +75,6 @@ static int openInputDevice(lua_State *L) { return luaL_error(L, "no free slot for new input device <%s>", inputdevice); } - printf("Opening input device <%s> in slot %d.\n", inputdevice, fd); - if(!strcmp("slider",inputdevice)) { /* special case: the power slider */ int pipefd[2]; @@ -106,7 +102,7 @@ static int openInputDevice(lua_State *L) { /* listen power slider events */ char *exec_file = "lipc-wait-event"; - char *arg1 = "-m"; // Hang for ever, don't exit on the first one, we're in a dedicated child, and we'll be closed on exit, so we don't care + char *arg1 = "-m"; // Hang for ever, don't exit on the first one: we're in a dedicated child, and we'll be killed/closed on exit, so we don't care char *arg2 = "-s"; char *arg3 = "0"; char *arg4 = "com.lab126.powerd"; @@ -123,8 +119,6 @@ static int openInputDevice(lua_State *L) { err(EXIT_FAILURE, "popen_noshell()"); } - printf("PID of our child is: %d (ours: %d)\n", (int)pclose_arg.pid, (int)getpid()); - while(fgets(std_out, sizeof(std_out)-1, fp)) { if(std_out[0] == 'g') { ev.code = CODE_IN_SAVER; @@ -167,11 +161,9 @@ static int openInputDevice(lua_State *L) { // We're done, go away :). _exit(EXIT_SUCCESS); } else { - printf("Slider pipe close in slot %d [inputfd[fd]: %d].\n", fd, pipefd[0]); close(pipefd[1]); inputfds[fd] = pipefd[0]; slider_pid = childpid; - printf("slider_pid is: %d\n", (int)slider_pid); } } else { inputfds[fd] = open(inputdevice, O_RDONLY | O_NONBLOCK, 0); @@ -192,26 +184,18 @@ static int openInputDevice(lua_State *L) { } static int closeInputDevices(lua_State *L) { - printf("closeInputDevices(): BEGIN\n"); #ifndef EMULATE_READER - int i, ret; + int i; for(i=0; i