aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Franke <christian.franke@t-online.de>2024-11-25 15:02:36 +0100
committerCorinna Vinschen <corinna@vinschen.de>2024-11-27 16:35:21 +0100
commit46d1e63c76c032d0a8ad4f30f75be7347e24cbb0 (patch)
treeef081fbf46ff34a642f0e86a46225f012eac0538
parent6614da9a71fc5cf24991b47fd62a56749c7f4ccc (diff)
downloadnewlib-46d1e63c76c032d0a8ad4f30f75be7347e24cbb0.zip
newlib-46d1e63c76c032d0a8ad4f30f75be7347e24cbb0.tar.gz
newlib-46d1e63c76c032d0a8ad4f30f75be7347e24cbb0.tar.bz2
Cygwin: sched_getscheduler: fix error handling
Fixes: 6b2a2aa4af1e ("Add missing files.") Signed-off-by: Christian Franke <christian.franke@t-online.de>
-rw-r--r--winsup/cygwin/sched.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc
index 71a1e86..22ff0c8 100644
--- a/winsup/cygwin/sched.cc
+++ b/winsup/cygwin/sched.cc
@@ -140,7 +140,10 @@ int
sched_getscheduler (pid_t pid)
{
if (pid < 0)
- return ESRCH;
+ {
+ set_errno (EINVAL);
+ return -1;
+ }
else
return SCHED_FIFO;
}