|
@@ -14,7 +14,7 @@
|
|
|
static struct stat parent, current;
|
|
static struct stat parent, current;
|
|
|
|
|
|
|
|
static int period;
|
|
static int period;
|
|
|
-const char *path;
|
|
|
|
|
|
|
+static const char *path;
|
|
|
|
|
|
|
|
static void __attribute__((__noreturn__)) usage(void)
|
|
static void __attribute__((__noreturn__)) usage(void)
|
|
|
{
|
|
{
|
|
@@ -98,12 +98,10 @@ int main(int argc, char *argv[])
|
|
|
sa.sa_flags = SA_SIGINFO;
|
|
sa.sa_flags = SA_SIGINFO;
|
|
|
sigemptyset(&sa.sa_mask);
|
|
sigemptyset(&sa.sa_mask);
|
|
|
sigfillset(&sa.sa_mask);
|
|
sigfillset(&sa.sa_mask);
|
|
|
- if (sigaction(SIGINFO, &sa, NULL)) {
|
|
|
|
|
|
|
+ if (sigaction(SIGINFO, &sa, NULL))
|
|
|
warn("SIGNFO not caught.");
|
|
warn("SIGNFO not caught.");
|
|
|
- }
|
|
|
|
|
- if (sigaction(SIGALRM, &sa, NULL)) {
|
|
|
|
|
|
|
+ if (sigaction(SIGALRM, &sa, NULL))
|
|
|
err(EXIT_FAILURE, "sigaction:ALARM");
|
|
err(EXIT_FAILURE, "sigaction:ALARM");
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/* timer, if set */
|
|
/* timer, if set */
|
|
|
if ((period > 0) ) {
|
|
if ((period > 0) ) {
|
|
@@ -111,12 +109,10 @@ int main(int argc, char *argv[])
|
|
|
its.it_interval.tv_nsec = 0;
|
|
its.it_interval.tv_nsec = 0;
|
|
|
its.it_value.tv_sec = its.it_interval.tv_sec;
|
|
its.it_value.tv_sec = its.it_interval.tv_sec;
|
|
|
its.it_value.tv_nsec = 0;
|
|
its.it_value.tv_nsec = 0;
|
|
|
- if (timer_create(CLOCK_REALTIME, NULL, &timerid)) {
|
|
|
|
|
|
|
+ if (timer_create(CLOCK_REALTIME, NULL, &timerid))
|
|
|
err(EXIT_FAILURE,"timer_create failed.");
|
|
err(EXIT_FAILURE,"timer_create failed.");
|
|
|
- }
|
|
|
|
|
- if (timer_settime(timerid, 0, &its, NULL)) {
|
|
|
|
|
|
|
+ if (timer_settime(timerid, 0, &its, NULL))
|
|
|
err(EXIT_FAILURE, "timer_settime failed.");
|
|
err(EXIT_FAILURE, "timer_settime failed.");
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* proceed */
|
|
/* proceed */
|