Skip to content
Snippets Groups Projects
Commit 544ca6db authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

update reset_timeout to not call setitimer if TIMEOUT_SECONDS is zero : this...

update reset_timeout to not call setitimer if TIMEOUT_SECONDS is zero : this isn't required because no timeout will ever have been set
parent 709ec881
No related branches found
No related tags found
No related merge requests found
...@@ -60,18 +60,21 @@ void reset_binary_c_timeout(void) ...@@ -60,18 +60,21 @@ void reset_binary_c_timeout(void)
void disable_binary_c_timeout(void) void disable_binary_c_timeout(void)
{ {
#ifdef LINUX #ifdef LINUX
struct itimerval value; if(TIMEOUT_SECONDS)
struct timeval tv;
tv.tv_sec=0; /* 0 disables the timer */
tv.tv_usec=0;
value.it_value=tv;
value.it_interval=tv;
if(setitimer(ITIMER_VIRTUAL,&value,0) == -1)
{ {
Exit_binary_c_no_stardata(BINARY_C_TIMED_OUT, struct itimerval value;
"Failed to allocate virtual timer"); struct timeval tv;
tv.tv_sec=0; /* 0 disables the timer */
tv.tv_usec=0;
value.it_value=tv;
value.it_interval=tv;
if(setitimer(ITIMER_VIRTUAL,&value,0) == -1)
{
Exit_binary_c_no_stardata(BINARY_C_TIMED_OUT,
"Failed to allocate virtual timer");
}
} }
#endif #endif // LINUX
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment