diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2024-01-21 16:07:54 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2024-09-08 23:54:20 +0200 |
commit | 56cf7f217d88e90b9dc89b0cc300dadb321f4c5a (patch) | |
tree | 22db40d40702be61bea20217c5ed4f9b1c05661a /fstests | |
parent | 35f0441fd524372c518847bc878c368b5314c2cc (diff) | |
download | hurd-56cf7f217d88e90b9dc89b0cc300dadb321f4c5a.tar.gz hurd-56cf7f217d88e90b9dc89b0cc300dadb321f4c5a.tar.bz2 hurd-56cf7f217d88e90b9dc89b0cc300dadb321f4c5a.zip |
Fix warnings in fstests
Message-ID: <20240121210757.1900938-3-flaviocruz@gmail.com>
Diffstat (limited to 'fstests')
-rw-r--r-- | fstests/fstests.c | 1 | ||||
-rw-r--r-- | fstests/timertest.c | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/fstests/fstests.c b/fstests/fstests.c index b7765034..ca602030 100644 --- a/fstests/fstests.c +++ b/fstests/fstests.c @@ -94,7 +94,6 @@ main (void) #endif printf ("All done.\n"); - malloc (0); return 0; } diff --git a/fstests/timertest.c b/fstests/timertest.c index 2d602560..6eca98ef 100644 --- a/fstests/timertest.c +++ b/fstests/timertest.c @@ -32,14 +32,20 @@ alarm_handler (int signo) int main(int argc, char *argv[]) { + struct sigaction alarm_sigaction = { 0 }; + sigset_t empty_sigset; struct itimerval real_timer; + sigemptyset (&empty_sigset); + real_timer.it_interval.tv_usec = 0; real_timer.it_interval.tv_sec = 1; real_timer.it_value.tv_usec = 0; real_timer.it_value.tv_sec = 1; - signal (SIGALRM, alarm_handler); + alarm_sigaction.sa_handler = &alarm_handler; + alarm_sigaction.sa_flags = SA_RESTART; + sigaction (SIGALRM, &alarm_sigaction, NULL); if (setitimer (ITIMER_REAL, &real_timer, 0) < 0) error (1, errno, "Setting timer"); @@ -56,7 +62,7 @@ main(int argc, char *argv[]) { puts ("Saw EOF. Pausing (no input)..."); fflush (stdout); - sigpause (0); + sigsuspend (&empty_sigset); } else printf ("Saw %.3o\n", c); |