aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32proc.c')
-rw-r--r--src/w32proc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index 159d6e00957..b0881c25d6c 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -669,15 +669,19 @@ setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
669int 669int
670alarm (int seconds) 670alarm (int seconds)
671{ 671{
672 struct itimerval new_values; 672#ifdef HAVE_SETITIMER
673 struct itimerval new_values, old_values;
673 674
674 new_values.it_value.tv_sec = seconds; 675 new_values.it_value.tv_sec = seconds;
675 new_values.it_value.tv_usec = 0; 676 new_values.it_value.tv_usec = 0;
676 new_values.it_interval.tv_sec = new_values.it_interval.tv_usec = 0; 677 new_values.it_interval.tv_sec = new_values.it_interval.tv_usec = 0;
677 678
678 setitimer (ITIMER_REAL, &new_values, NULL); 679 if (setitimer (ITIMER_REAL, &new_values, &old_values) < 0)
679 680 return 0;
681 return old_values.it_value.tv_sec;
682#else
680 return seconds; 683 return seconds;
684#endif
681} 685}
682 686
683/* Defined in <process.h> which conflicts with the local copy */ 687/* Defined in <process.h> which conflicts with the local copy */