pkgsrc/emulators/hercules/patches/patch-ag

35 lines
1.1 KiB
Text

$NetBSD: patch-ag,v 1.1 2001/02/26 14:49:35 agc Exp $
Fix for coredump on exit on NetBSD from Wolfgang Solfrank
--- cpu.c 2001/02/26 14:35:56 1.1
+++ cpu.c 2001/02/26 14:40:26
@@ -741,19 +741,22 @@
void *cpu_thread (REGS *regs)
{
-#define CPU_PRIORITY 15 /* CPU thread priority */
#ifndef WIN32
- /* Set CPU thread priority */
- if (setpriority(PRIO_PROCESS, 0, CPU_PRIORITY))
- logmsg ("HHC621I CPU thread set priority failed: %s\n",
- strerror(errno));
+ struct sched_param sp;
+ int p;
+
+ if (pthread_getschedparam(pthread_self(), &p, &sp)
+ || (sp.sched_priority = sched_get_priority_min(p),
+ pthread_setschedparam(pthread_self(), p, &sp)))
+ logmsg ("HHC621I CPU thread set priority failed: %s\n",
+ strerror(errno));
/* Display thread started message on control panel */
logmsg ("HHC620I CPU%4.4X thread started: tid=%8.8lX, pid=%d, "
"priority=%d\n",
regs->cpuad, thread_id(), getpid(),
- getpriority(PRIO_PROCESS,0));
+ sp.sched_priority);
#endif
logmsg ("HHC630I CPU%4.4X Architecture Mode %s\n",regs->cpuad,