[Pkg-sysvinit-devel] Bug#463504: Bug#463504: division by zero when xdm started at 01

Petter Reinholdtsen pere at hungry.com
Fri Feb 1 06:28:03 UTC 2008


[Petter Reinholdtsen]
> This is a problem with sysv-rc, all right.  It should not break down
> even if there are no progress bar steps to count because xdm (or kdm
> and gdm) is the first entry in the runlevel.  Will have a look at
> the logic to fix it.

Can you test this patch?

Index: debian/sysv-rc/etc/init.d/rc
===================================================================
--- debian/sysv-rc/etc/init.d/rc        (revision 1227)
+++ debian/sysv-rc/etc/init.d/rc        (working copy)
@@ -83,6 +83,9 @@
 # Stub to do progress bar ticks (for splash programs) on startup
 #
 startup_progress() {
+    # Avoid divide by zero if anyone moved xdm/kdm/gdm first in a runlevel.
+    if [ 0 = "$num_steps" ] ; then return; fi
+
     step=$(($step + $step_change))
     progress=$(($step * $progress_size / $num_steps + $first_step))
     $debug splash_progress "$progress" || true

Happy hacking,
-- 
Petter Reinholdtsen





More information about the Pkg-sysvinit-devel mailing list