From 771465fed0cf50ee2dd790723245fc091699c324 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 17 May 2004 01:38:02 +0000 Subject: re-indentation, bug fixes, hooks for pre-emptive async cancelation --- sched_setscheduler.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'sched_setscheduler.c') diff --git a/sched_setscheduler.c b/sched_setscheduler.c index 47564d5..138ad94 100644 --- a/sched_setscheduler.c +++ b/sched_setscheduler.c @@ -39,7 +39,7 @@ #include "sched.h" int -sched_setscheduler(pid_t pid, int policy) +sched_setscheduler (pid_t pid, int policy) { /* * Win32 only has one policy which we call SCHED_OTHER. @@ -50,18 +50,21 @@ sched_setscheduler(pid_t pid, int policy) */ if (0 != pid) { - int selfPid = (int) GetCurrentProcessId(); + int selfPid = (int) GetCurrentProcessId (); if (pid != selfPid) - { - HANDLE h = OpenProcess(PROCESS_SET_INFORMATION, PTW32_FALSE, (DWORD) pid); + { + HANDLE h = + OpenProcess (PROCESS_SET_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; + } + } } if (SCHED_OTHER != policy) -- cgit v1.2.3