Ticket #7932: 7932-win32_nice.2.patch

File 7932-win32_nice.2.patch, 1.0 KB (added by Jeff Lu <jll544@…>, 14 years ago)

Revised patch - fixes a typo

  • libs/libmythdb/compat.h

     
    182182#ifdef USING_MINGW
    183183#define lstat stat
    184184#define bzero(x, y) memset((x), 0, (y))
    185 #define nice(x) ((int)!::SetThreadPriority(\
    186                     ::GetCurrentThread(), ((x) < -10) ? \
    187                         2 : (((x) < 0) ? \
    188                         1 : (((x) > 10) ? \
    189                         2 : (((x) > 0) ? 1 : 0)))))
     185#define nice(x) ((int)!::SetPriorityClass(\
     186                    ::GetCurrentProcess(), ((x) < -10) ? \
     187                        HIGH_PRIORITY_CLASS : (((x) < 0) ? \
     188                        ABOVE_NORMAL_PRIORITY_CLASS : (((x) > 10) ? \
     189                        IDLE_PRIORITY_CLASS : (((x) > 0) ? \
     190                        BELOW_NORMAL_PRIORITY_CLASS : \
     191                        NORMAL_PRIORITY_CLASS)))))
    190192#define PRIO_PROCESS 0
    191193#define setpriority(x, y, z) ((x) == PRIO_PROCESS && y == 0 ? nice(z) : -1)
    192194#endif // USING_MINGW