Implemented renicing (-20) in gnokiid mode uc_works1
authorshort <>
Sat, 16 Mar 2002 21:00:05 +0000 (21:00 +0000)
committershort <>
Sat, 16 Mar 2002 21:00:05 +0000 (21:00 +0000)
gnokii/gnokii.c
include/uccompat.h

index e6692ab..1cbe8fe 100644 (file)
@@ -4119,6 +4119,8 @@ int monitormode(int argc, char *argv[])
 
 #ifdef UCLINUX
 
+#define NICE_LEVEL (-20)
+
 static void gnokiid_SIGCHLD(int signo)
 {
        fprintf (stderr, _("Child process exited, aborting...\n"));
@@ -4180,6 +4182,8 @@ static int gnokiid(int argc, char *argv[])
 #ifdef DEBUG
   fprintf (stderr, _("Entering gnokiid virtual modem main loop...\n"));
 #endif
+       if (nice(NICE_LEVEL))
+               fprintf (stderr, _("WARNING: nice level change failed (by %d)\n"),NICE_LEVEL);
 
        VM_ThreadLoop();
 
index fa3a2b7..f3676c9 100644 (file)
@@ -35,6 +35,7 @@ extern char * strrchr __P ((const char *, int));
 
 extern pid_t getpid(void);
 extern int execv(const char *path, char *const argv[]);
+extern int nice(int inc);
 
 
 #endif /* UCCOMPAT */