update from texinfo
[gnulib.git] / lib / nanosleep.c
index 1732c59..7a7cc02 100644 (file)
@@ -42,7 +42,7 @@ enum { BILLION = 1000 * 1000 * 1000 };
 
 #if HAVE_BUG_BIG_NANOSLEEP
 
-void
+static void
 getnow (struct timespec *t)
 {
 # if defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME
@@ -147,14 +147,18 @@ rpl_nanosleep (const struct timespec *requested_delay,
   /* set up sig handler */
   if (! initialized)
     {
-      struct sigaction oldact, newact;
-      newact.sa_handler = sighandler;
-      sigemptyset (&newact.sa_mask);
-      newact.sa_flags = 0;
+      struct sigaction oldact;
 
       sigaction (SIGCONT, NULL, &oldact);
       if (get_handler (&oldact) != SIG_IGN)
-       sigaction (SIGCONT, &newact, NULL);
+       {
+         struct sigaction newact;
+
+         newact.sa_handler = sighandler;
+         sigemptyset (&newact.sa_mask);
+         newact.sa_flags = 0;
+         sigaction (SIGCONT, &newact, NULL);
+       }
       initialized = true;
     }