Skip to content
Snippets Groups Projects
Commit b8ae42ad authored by Jonathan Hanks's avatar Jonathan Hanks
Browse files

Closes #63. Update the error handling code when daqd calls nice.

Fix the error handling code to work with how nice has been implemented for a while.  Change to clearing errno and checking it after the call as proscribed by the man page.
parent d5f9d56a
No related branches found
No related tags found
1 merge request!102Closes #63. Update the error handling code when daqd calls nice.
......@@ -2038,16 +2038,20 @@ main( int argc, char* argv[] )
}
}
int set_nice = nice( -20 );
if ( set_nice != 0 )
const int nice_val = -20;
errno = 0;
int set_nice = nice( nice_val );
if ( errno != 0 )
{
system_log( 1,
"Unable to set to nice = -20 -error %s\n",
strerror( set_nice ) );
"Unable to set to nice %d -error %s\n",
nice_val,
strerror( errno ) );
}
else
{
system_log( 1, "Set daqd to nice = -20\n" );
system_log(
1, "Set daqd to nice %d returned %d\n", nice_val, set_nice );
}
// Switch effective to real user ID -- can always switch back to saved
// effective seteuid (getuid ());
......
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