--- COPYING +++ COPYING 2008-01-07 15:43:31.885812792 +0100 @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -304,8 +304,9 @@ the "copyright" line and a pointer to wh GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. --- 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; } @@ -412,3 +416,36 @@ void dump_status(void) node->name, node->status, node->num_deps, node->interactive, node->importance); } #endif + +#ifdef TEST +void *xcalloc(size_t nmemb, size_t size) +{ + void *r; + if ((r = (void *)calloc(nmemb, size)) == 0) { + fprintf(stderr, "calloc: out of memory\n"); + exit(1); + } + return r; +} + +int main(int argc, char **argv) +{ + struct makenode *nodevec; + char makefile[64]; + + if (argc != 2) + goto out; + nodevec = xcalloc(1, sizeof(*nodevec)); + + snprintf(makefile, sizeof(makefile), "depend.%s", argv[1]); + parse_makefile(makefile); + check_run_files(argv[1], "5", "6"); +out: + while ((nodevec = pickup_task())) { + fprintf(stdout, "%s\n", nodevec->name); + finish_task(nodevec); + } + + return 0; +} +#endif --- proc.c +++ proc.c 2008-01-07 15:43:31.809803114 +0100 @@ -13,8 +13,8 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. * **************************************************************** */ @@ -69,6 +69,7 @@ int read_proc(unsigned long int * const } fclose(stat); + /* These fields are not present in /proc/stat for 2.4 kernels */ running = scan_one(StatBuf, "procs_running"); blocked = scan_one(StatBuf, "procs_blocked"); --- proc.h +++ proc.h 2008-01-07 15:43:31.913816357 +0100 @@ -12,8 +12,8 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. * **************************************************************** */ --- startpar.8 +++ startpar.8 2008-01-07 15:43:31.845807697 +0100 @@ -85,11 +85,11 @@ like behaviour. This option takes three .IR boot ", " start ", and " stop for reading .IR .depend.boot " or " .depend.start " or " .depend.stop -repectivly in the directory +respectively in the directory .IR /etc/init.d/ . By scanning the boot and runlevel directories in .I /etc/init.d/ -it then executes the appropiate scripts in parallel. +it then executes the appropriate scripts in parallel. .SH FILES .I /etc/init.d/.depend.boot @@ -101,7 +101,7 @@ it then executes the appropiate scripts .SH SEE ALSO .BR init.d (7), .BR insserv (8), -.BR startproc (8) +.BR startproc (8). .SH COPYRIGHT 2003,2004 SuSE Linux AG, Nuernberg, Germany. --- startpar.c +++ startpar.c 2008-01-07 15:43:31.801802095 +0100 @@ -12,8 +12,8 @@ * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the - * Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301, USA. * **************************************************************** */ @@ -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); @@ -1036,9 +1036,13 @@ int main(int argc, char **argv) exit (1); } #endif +#if VERBOSE printf(i ? " %d" : "%d", resvec[i]); +#endif /* VERBOSE */ } +#if VERBOSE printf("\n"); +#endif /* VERBOSE */ } return 0; }