summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/exec/posix/src/sched.c6
-rw-r--r--cpukit/posix/src/sched.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/c/src/exec/posix/src/sched.c b/c/src/exec/posix/src/sched.c
index cacb3400c4..b04ee5ec1a 100644
--- a/c/src/exec/posix/src/sched.c
+++ b/c/src/exec/posix/src/sched.c
@@ -129,7 +129,11 @@ int sched_rr_get_interval(
* Only supported for the "calling process" (i.e. this node).
*/
- assert( pid == getpid() );
+ if ( pid == getpid() )
+ set_errno_and_return_minus_one( ESRCH );
+
+ if ( !interval )
+ set_errno_and_return_minus_one( EINVAL );
_POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval );
return 0;
diff --git a/cpukit/posix/src/sched.c b/cpukit/posix/src/sched.c
index cacb3400c4..b04ee5ec1a 100644
--- a/cpukit/posix/src/sched.c
+++ b/cpukit/posix/src/sched.c
@@ -129,7 +129,11 @@ int sched_rr_get_interval(
* Only supported for the "calling process" (i.e. this node).
*/
- assert( pid == getpid() );
+ if ( pid == getpid() )
+ set_errno_and_return_minus_one( ESRCH );
+
+ if ( !interval )
+ set_errno_and_return_minus_one( EINVAL );
_POSIX_Interval_to_timespec( _Thread_Ticks_per_timeslice, interval );
return 0;