Commit 7f226286 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(main): New argument: --no-sa-restart. Don't use SA_RESTART if given.

parent 22f68219
...@@ -78,7 +78,8 @@ my_sighandler(int UNUSED(x)) ...@@ -78,7 +78,8 @@ my_sighandler(int UNUSED(x))
} }
int int
main(void) main(int argc,
char **argv)
{ {
fd_set r; fd_set r;
struct timeval timeout; struct timeval timeout;
...@@ -90,6 +91,17 @@ main(void) ...@@ -90,6 +91,17 @@ main(void)
time_t before; time_t before;
time_t after; time_t after;
pid_t pid; pid_t pid;
int use_sa_restart = 1;
if (argc == 1)
use_sa_restart = 1;
else if (argc == 2 && !strcmp(argv[1], "--no-sa-restart"))
use_sa_restart = 0;
else
{
fprintf(stderr, "%s: usage: %s [--no-sa-restart]\n", argv[0], argv[0]);
return 1;
}
link_ansi(); link_ansi();
...@@ -110,7 +122,7 @@ main(void) ...@@ -110,7 +122,7 @@ main(void)
#ifdef HAVE_STRUCT_SIGACTION #ifdef HAVE_STRUCT_SIGACTION
sigemptyset(&act.sa_mask); sigemptyset(&act.sa_mask);
#ifdef SA_RESTART #ifdef SA_RESTART
act.sa_flags = SA_RESTART; act.sa_flags = use_sa_restart ? SA_RESTART : 0;
#else #else
act.sa_flags = 0; act.sa_flags = 0;
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment