[Pkg-sysvinit-devel] Bug#484883: [sysvinit] sync startpar with suse sysvinit 2.86-133.26

Kel Modderman kel at otaku42.de
Sat Jun 7 08:15:59 UTC 2008


Package: sysvinit
Version: 2.86.ds1-58
Severity: wishlist
Tags: patch

Hi,

I download suse sysvinit version 2.86-133.26 from [0] and notice they have a
patch for startpar that we do not have, it is attached.

It makes 2 changes:
1) set started process state to "T_RUNNING"
2) change an int value to a double for more precision

[0] http://ftp.nux.ipb.pt/pub/dists/opensuse/repositories/Base:/build/standard/src/

Thanks, Kel.
---
* Wed Oct 31 2007 werner at suse.de
- startpar: make iorate a double
* Wed Jun 20 2007 coolo at suse.de
- startpar: mark started processes as running

--- makeboot.c
+++ makeboot.c	2007-10-31 18:42:03.145266987 +0100
@@ -339,6 +339,10 @@ struct makenode *pickup_task(void)
 			best = node;
 		}
 	}
+	if (best) {
+		blogger("service %s", best->name);
+		best->status = T_RUNNING;
+	}
 	return best;
 }
 
--- startpar.c
+++ startpar.c	2008-01-07 15:43:31.801802095 +0100
@@ -72,7 +72,7 @@ struct prg {
 static struct prg *prgs;
 static int inpar, par;
 static int pidpipe[2];
-static int iorate = 800;
+static double iorate = 800.0;
 
 void *xcalloc(size_t nmemb, size_t size)
 {
@@ -240,8 +240,8 @@ static int checksystem(const int par, co
   if (read_proc(&prcs_run, &prcs_blked))
     return par;
 
-  newpar = (par*numcpu) - prcs_run + 1; /* +1 for startpar its self */
-  newpar -= (prcs_blked * iorate);	/* I/O load reduction */
+  newpar  = (par*numcpu) - prcs_run + 1; 	/* +1 for startpar its self */
+  newpar -= (int)(((double)prcs_blked)*iorate);	/* I/O load reduction */
 
 #if DEBUG
   fprintf(stderr, "checksystem par=%d newpar=%d (prcs_run=%u) %ld\n", par, newpar, prcs_run, time(0));
@@ -573,9 +573,9 @@ int main(int argc, char **argv)
 	  usage(0);
 	  break;
 	case 'i':
-	  iorate = atoi(optarg);
-	  if (iorate <= 0)
-	    iorate = 800;
+	  iorate = atof(optarg);
+	  if (iorate < 0.0)
+	    iorate = 800.0;
 	  break;
 	default:
 	  usage(1);
 





More information about the Pkg-sysvinit-devel mailing list