Changeset 7656
- Timestamp:
- 10/08/12 21:21:56 (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/global-functions.h
r7655 r7656 130 130 * oscam-simples 131 131 * =========================== */ 132 extern void cs_setpriority(int32_t);133 132 extern char *get_servicename(struct s_client *cl, uint16_t srvid, uint16_t caid, char *buf); 134 133 extern char *get_tiername(uint16_t tierid, uint16_t caid, char *buf); -
trunk/oscam-config-global.c
r7638 r7656 126 126 #endif 127 127 128 #ifdef __CYGWIN__ 129 #include <windows.h> 130 #endif 131 128 132 void global_fixups_fn(void *UNUSED(var)) { 129 133 if (!cfg.usrfile) cfg.disableuserfile = 1; … … 132 136 if (cfg.ftimeout < 100) cfg.ftimeout *= 1000; 133 137 if (cfg.nice < -20 || cfg.nice > 20) cfg.nice = 99; 134 if (cfg.nice != 99) cs_setpriority(cfg.nice); 138 if (cfg.nice != 99) { 139 #ifndef __CYGWIN__ 140 setpriority(PRIO_PROCESS, 0, cfg.nice); 141 #else 142 HANDLE WinId; 143 uint32_t wprio; 144 switch ((cfg.nice + 20) / 10) { 145 case 0: wprio = REALTIME_PRIORITY_CLASS; break; 146 case 1: wprio = HIGH_PRIORITY_CLASS; break; 147 case 2: wprio = NORMAL_PRIORITY_CLASS; break; 148 default: wprio = IDLE_PRIORITY_CLASS; break; 149 } 150 WinId = GetCurrentProcess(); 151 SetPriorityClass(WinId, wprio); 152 #endif 153 } 135 154 if (cfg.srtimeout <= 0) cfg.srtimeout = 1500; 136 155 if (cfg.srtimeout < 100) cfg.srtimeout *= 1000; -
trunk/oscam-simples.c
r7655 r7656 6 6 7 7 extern struct s_cardsystem cardsystems[CS_MAX_MOD]; 8 9 #if defined(__CYGWIN__)10 #include <windows.h>11 void cs_setpriority(int32_t prio)12 {13 HANDLE WinId;14 uint32_t wprio;15 switch((prio+20)/10)16 {17 case 0: wprio=REALTIME_PRIORITY_CLASS; break;18 case 1: wprio=HIGH_PRIORITY_CLASS; break;19 case 2: wprio=NORMAL_PRIORITY_CLASS; break;20 default: wprio=IDLE_PRIORITY_CLASS; break;21 }22 WinId=GetCurrentProcess();23 SetPriorityClass(WinId, wprio);24 }25 #else26 void cs_setpriority(int32_t prio)27 {28 #ifdef PRIO_PROCESS29 setpriority(PRIO_PROCESS, 0, prio); // ignore errors30 #endif31 }32 #endif33 8 34 9 /* Gets the servicename. Make sure that buf is at least 32 bytes large. */
Note:
See TracChangeset
for help on using the changeset viewer.