65 extern struct termios
term;
113 if( tcsetattr(fileno(stdin), TCSANOW, &
term) < 0)
124 sprintf(sysbuf,
"kill `ps ax | grep -- '-tn %d' | grep -v grep | awk '{print $1}'` 1>> /dev/null 2>&1",
lp_ppid);
127 st_report(
"Killing any Remaining Processes belonging to PPID: %d",
lp_ppid);
128 sprintf(sysbuf,
"pkill -g %d",
lp_ppid);
171 static time_t old_time = 0;
182 sprintf(cmdBuf,
"formula /w .lp.history");
202 st_print(
"Caught Signal %d\n", sig);
203 st_print(
"Hit <Control-C> within 2 Seconds to Exit\n");
212 st_print(
"Caught 2nd signal: %d\n", sig);
219 sprintf(cmdBuf,
"formula /w .lp.history");
239 struct sigaction new_action, old_action;
248 sigemptyset (&new_action.sa_mask);
249 new_action.sa_flags = 0;
251 sigaction (SIGINT, NULL, &old_action);
252 if (old_action.sa_handler != SIG_IGN)
254 sigaction (SIGINT, &new_action, NULL);
258 st_fail(
"main(): Unable to setup signal(INT)");
261 sigaction (SIGHUP, NULL, &old_action);
262 if (old_action.sa_handler != SIG_IGN)
264 sigaction (SIGHUP, &new_action, NULL);
268 st_fail(
"main(): Unable to setup signal(HUP)");
271 sigaction (SIGTERM, NULL, &old_action);
272 if (old_action.sa_handler != SIG_IGN)
274 sigaction (SIGTERM, &new_action, NULL);
278 st_fail(
"main(): Unable to setup signal(TERM)");
281 sigaction (SIGKILL, NULL, &old_action);
282 if (old_action.sa_handler != SIG_IGN)
284 sigaction (SIGKILL, &new_action, NULL);
288 st_fail(
"main(): Unable to setup signal(KILL)");
291 sigaction (SIGQUIT, NULL, &old_action);
292 if (old_action.sa_handler != SIG_IGN)
294 sigaction (SIGQUIT, &new_action, NULL);
298 st_fail(
"main(): Unable to setup signal(QUIT)");
int history_already_written
void sig_handler(int sig)
int sock_send(struct SOCK *s, char *message)
void exit_proc(int arg1, void *arg2)