summaryrefslogtreecommitdiff
path: root/sched_setscheduler.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_setscheduler.c
parent8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff)
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'sched_setscheduler.c')
-rw-r--r--sched_setscheduler.c23
1 files changed, 13 insertions, 10 deletions
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)