VirtualBox

Changeset 1313 in kBuild


Ignore:
Timestamp:
Dec 2, 2007 5:56:14 AM (17 years ago)
Author:
bird
Message:

Fixed --affinity and corrected --priority help.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/main.c

    r1306 r1313  
    395395  --affinity=mask             Sets the CPU affinity on some hosts.\n"),
    396396    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\
    399398                                1 = idle / max nice;\n\
    400399                                2 = below normal / nice 10;\n\
     
    736735#ifdef WINDOWS32
    737736  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
    738742  switch (process_priority)
    739743    {
     
    746750      default:    fatal(NILF, _("invalid priority %d\n"), process_priority);
    747751    }
    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 ());
    751755
    752756#else /*#elif HAVE_NICE */
     
    762766      default:    fatal(NILF, _("invalid priority %d\n"), process_priority);
    763767    }
    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
    767772}
    768773#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette