Changeset 1313 in kBuild
- Timestamp:
- Dec 2, 2007 5:56:14 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/main.c
r1306 r1313 395 395 --affinity=mask Sets the CPU affinity on some hosts.\n"), 396 396 N_("\ 397 --priority=0-5 Sets the process priority / nice level:\n\ 398 0 = no change;\n\ 397 --priority=1-5 Sets the process priority / nice level:\n\ 399 398 1 = idle / max nice;\n\ 400 399 2 = below normal / nice 10;\n\ … … 736 735 #ifdef WINDOWS32 737 736 DWORD dwPriority; 737 if (process_affinity) 738 if (!SetProcessAffinityMask (GetCurrentProcess (), process_affinity)) 739 fprintf (stderr, "warning: SetPriorityClass (,%#x) failed with last error %d\n", 740 process_affinity, GetLastError()); 741 738 742 switch (process_priority) 739 743 { … … 746 750 default: fatal(NILF, _("invalid priority %d\n"), process_priority); 747 751 } 748 SetPriorityClass(GetCurrentProcess(), dwPriority);749 if (process_affinity)750 SetThreadAffinityMask(GetCurrentProcess(), process_affinity);752 if (!SetPriorityClass (GetCurrentProcess (), dwPriority)) 753 fprintf (stderr, "warning: SetPriorityClass (,%#x) failed with last error %d\n", 754 dwPriority, GetLastError ()); 751 755 752 756 #else /*#elif HAVE_NICE */ … … 762 766 default: fatal(NILF, _("invalid priority %d\n"), process_priority); 763 767 } 764 nice (nice_level); 765 #endif 766 /** @todo bitch about failures. */ 768 errno = 0; 769 if (nice (nice_level) == -1 && errno != 0) 770 fprintf (stderr, "warning: nice (%d) failed: %s\n", nice, strerror (errno)); 771 #endif 767 772 } 768 773 #endif
Note:
See TracChangeset
for help on using the changeset viewer.