summaryrefslogtreecommitdiff
path: root/sched_getscheduler.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-05-17 01:38:02 +0000
committerrpj <rpj>2004-05-17 01:38:02 +0000
commit771465fed0cf50ee2dd790723245fc091699c324 (patch)
treed8c18d095a33fe7c4564bd90c5f313bb9e4057dd /sched_getscheduler.c
parent8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff)
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'sched_getscheduler.c')
-rw-r--r--sched_getscheduler.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sched_getscheduler.c b/sched_getscheduler.c
index 5e7728a..144dec5 100644
--- a/sched_getscheduler.c
+++ b/sched_getscheduler.c
@@ -39,7 +39,7 @@
#include "sched.h"
int
-sched_getscheduler(pid_t pid)
+sched_getscheduler (pid_t pid)
{
/*
* Win32 only has one policy which we call SCHED_OTHER.
@@ -48,18 +48,21 @@ sched_getscheduler(pid_t pid)
*/
if (0 != pid)
{
- int selfPid = (int) GetCurrentProcessId();
+ int selfPid = (int) GetCurrentProcessId ();
if (pid != selfPid)
- {
- HANDLE h = OpenProcess(PROCESS_QUERY_INFORMATION, PTW32_FALSE, (DWORD) pid);
+ {
+ HANDLE h =
+ OpenProcess (PROCESS_QUERY_INFORMATION, PTW32_FALSE, (DWORD) pid);
- if (NULL == h)
- {
- errno = (GetLastError() == (0xFF & ERROR_ACCESS_DENIED)) ? EPERM : ESRCH;
- return -1;
- }
- }
+ if (NULL == h)
+ {
+ errno =
+ (GetLastError () ==
+ (0xFF & ERROR_ACCESS_DENIED)) ? EPERM : ESRCH;
+ return -1;
+ }
+ }
}
return SCHED_OTHER;