22 #include <grass/gis.h>
23 #include <grass/glocale.h>
30 static RETSIGTYPE handle_sigpipe(
int sig)
35 static RETSIGTYPE handle_sigterm(
int sig)
53 struct sigaction sigact;
66 G_warning(
"Usage: %s <name> [-]", argv[0]);
73 foreground = (argc >= 3 && argv[2][0] ==
'-');
77 sigact.sa_handler = handle_sigpipe;
78 sigemptyset(&sigact.sa_mask);
80 sigaction(SIGPIPE, &sigact,
NULL);
82 sigact.sa_handler = handle_sigterm;
83 sigemptyset(&sigact.sa_mask);
85 sigaction(SIGTERM, &sigact,
NULL);
90 G_message(_(
"Graphics driver [%s] started"), me);
110 setpgrp(0, getpid());
135 G_warning(
"Monitor <%s>: Caught SIGPIPE", me);
143 G_warning(
"Monitor <%s>: Premature EOF", me);