diff options
Diffstat (limited to 'sched_getscheduler.c')
-rw-r--r-- | sched_getscheduler.c | 23 |
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; |