I am trying to run the twinkle command line from a child process. For example, for example:
int hangup() { write_on_display("line3", " "); write_on_display("hide_icon", "DIALTONE"); write_on_display("hide_icon", "BACKLIGHT"); int pid = fork(); if (pid == 0) { int res = execl("/usr/bin/twinkle", " ", "--immediate", "--cmd", "answerbye", (char *) NULL); _exit(0); } else { perror("hangup"); return 0; } return 1; }
but the flicker becomes a zombie:
10020 pts/1 Z+ 0:00 [twinkle] <defunct> 10040 pts/1 Z+ 0:00 [twinkle] <defunct> 10053 pts/1 Z+ 0:00 [twinkle] <defunct> 10064 pts/1 Z+ 0:00 [twinkle] <defunct> 10097 pts/1 Z+ 0:00 [twinkle] <defunct> 10108 pts/1 Z+ 0:00 [twinkle] <defunct> 10130 pts/1 Z+ 0:00 [twinkle] <defunct>
I tried to set the signal (SIGCHLD, SIG_IGN); but unsuccessfully. In fact, I think the baby process is dying before the shine ends.
Flickering from the command line, for example:
twinkle --immediate --call 100
doesn't make zombies - the flicker closes properly. What am I missing there?
source share