nanosleep now returns -1 and EINTR when a signal interrupts EINTR.

This commit is contained in:
Joel Sherrill
1996-08-13 14:47:31 +00:00
parent f48c906895
commit 85f5b4ab06
2 changed files with 16 additions and 4 deletions

View File

@@ -120,7 +120,13 @@ void *POSIX_Init(
Signal_occurred = 0; Signal_occurred = 0;
status = nanosleep ( &tv, &tr ); status = nanosleep ( &tv, &tr );
assert( !status );
if ( status == -1 ) {
assert( errno == EINTR );
assert( tr.tv_nsec || tr.tv_sec );
} else if ( !status ) {
assert( !tr.tv_nsec && !tr.tv_sec );
}
printf( printf(
"Init: signal was %sprocessed with %d:%d time remaining\n", "Init: signal was %sprocessed with %d:%d time remaining\n",

View File

@@ -120,7 +120,13 @@ void *POSIX_Init(
Signal_occurred = 0; Signal_occurred = 0;
status = nanosleep ( &tv, &tr ); status = nanosleep ( &tv, &tr );
assert( !status );
if ( status == -1 ) {
assert( errno == EINTR );
assert( tr.tv_nsec || tr.tv_sec );
} else if ( !status ) {
assert( !tr.tv_nsec && !tr.tv_sec );
}
printf( printf(
"Init: signal was %sprocessed with %d:%d time remaining\n", "Init: signal was %sprocessed with %d:%d time remaining\n",