David Marec 8 miesięcy temu
rodzic
commit
c476fcfe23
1 zmienionych plików z 5 dodań i 9 usunięć
  1. 5 9
      ismounted/ismounted.c

+ 5 - 9
ismounted/ismounted.c

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