aboutsummaryrefslogtreecommitdiffstats
path: root/src/timeout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeout.c')
-rw-r--r--src/timeout.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/timeout.c b/src/timeout.c
index 34cf49e32..422220246 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -95,14 +95,14 @@ enum
static struct option const long_options[] =
{
- {"kill-after", required_argument, NULL, 'k'},
- {"signal", required_argument, NULL, 's'},
- {"verbose", no_argument, NULL, 'v'},
- {"foreground", no_argument, NULL, FOREGROUND_OPTION},
- {"preserve-status", no_argument, NULL, PRESERVE_STATUS_OPTION},
+ {"kill-after", required_argument, nullptr, 'k'},
+ {"signal", required_argument, nullptr, 's'},
+ {"verbose", no_argument, nullptr, 'v'},
+ {"foreground", no_argument, nullptr, FOREGROUND_OPTION},
+ {"preserve-status", no_argument, nullptr, PRESERVE_STATUS_OPTION},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
- {NULL, 0, NULL, 0}
+ {nullptr, 0, nullptr, 0}
};
/* Start the timeout after which we'll receive a SIGALRM.
@@ -120,9 +120,9 @@ settimeout (double duration, bool warn)
struct timespec ts = dtotimespec (duration);
struct itimerspec its = { {0, 0}, ts };
timer_t timerid;
- if (timer_create (CLOCK_REALTIME, NULL, &timerid) == 0)
+ if (timer_create (CLOCK_REALTIME, nullptr, &timerid) == 0)
{
- if (timer_settime (timerid, 0, &its, NULL) == 0)
+ if (timer_settime (timerid, 0, &its, nullptr) == 0)
return;
else
{
@@ -153,7 +153,7 @@ settimeout (double duration, bool warn)
tv.tv_usec--;
}
struct itimerval it = { {0, 0}, tv };
- if (setitimer (ITIMER_REAL, &it, NULL) == 0)
+ if (setitimer (ITIMER_REAL, &it, nullptr) == 0)
return;
else
{
@@ -375,7 +375,7 @@ unblock_signal (int sig)
sigset_t unblock_set;
sigemptyset (&unblock_set);
sigaddset (&unblock_set, sig);
- if (sigprocmask (SIG_UNBLOCK, &unblock_set, NULL) != 0)
+ if (sigprocmask (SIG_UNBLOCK, &unblock_set, nullptr) != 0)
error (0, errno, _("warning: sigprocmask"));
}
@@ -388,7 +388,7 @@ install_sigchld (void)
sa.sa_flags = SA_RESTART; /* Restart syscalls if possible, as that's
more likely to work cleanly. */
- sigaction (SIGCHLD, &sa, NULL);
+ sigaction (SIGCHLD, &sa, nullptr);
/* We inherit the signal mask from our parent process,
so ensure SIGCHLD is not blocked. */
@@ -404,12 +404,12 @@ install_cleanup (int sigterm)
sa.sa_flags = SA_RESTART; /* Restart syscalls if possible, as that's
more likely to work cleanly. */
- sigaction (SIGALRM, &sa, NULL); /* our timeout. */
- sigaction (SIGINT, &sa, NULL); /* Ctrl-C at terminal for example. */
- sigaction (SIGQUIT, &sa, NULL); /* Ctrl-\ at terminal for example. */
- sigaction (SIGHUP, &sa, NULL); /* terminal closed for example. */
- sigaction (SIGTERM, &sa, NULL); /* if we're killed, stop monitored proc. */
- sigaction (sigterm, &sa, NULL); /* user specified termination signal. */
+ sigaction (SIGALRM, &sa, nullptr); /* our timeout. */
+ sigaction (SIGINT, &sa, nullptr); /* Ctrl-C at terminal for example. */
+ sigaction (SIGQUIT, &sa, nullptr); /* Ctrl-\ at terminal for example. */
+ sigaction (SIGHUP, &sa, nullptr); /* terminal closed for example. */
+ sigaction (SIGTERM, &sa, nullptr); /* if killed, stop monitored proc. */
+ sigaction (sigterm, &sa, nullptr); /* user specified termination signal. */
}
/* Block all signals which were registered with cleanup() as the signal
@@ -475,7 +475,7 @@ main (int argc, char **argv)
initialize_exit_failure (EXIT_CANCELED);
atexit (close_stdout);
- while ((c = getopt_long (argc, argv, "+k:s:v", long_options, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "+k:s:v", long_options, nullptr)) != -1)
{
switch (c)
{