[PATCH] Cygwin: sched_getscheduler: fix error handling
Christian Franke
Christian.Franke@t-online.de
Sun Nov 24 10:11:23 GMT 2024
Long standing (2001) minor issue.
--
Regards,
Christian
-------------- next part --------------
From eb11a9ee855087ad5f92f77ec35c12c43a79db64 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Sun, 24 Nov 2024 10:41:21 +0100
Subject: [PATCH] Cygwin: sched_getscheduler: fix error handling
Signed-off-by: Christian Franke <christian.franke@t-online.de>
---
winsup/cygwin/sched.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc
index 71a1e868f..22ff0c8e8 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;
}
--
2.45.1
More information about the Cygwin-patches
mailing list