Bug#612992: grub-pc: function return value clamped to 0 or 1

Josh Triplett josh at joshtriplett.org
Sat Feb 12 05:27:47 UTC 2011


Package: grub-pc
Version: 1.99~rc1-2
Severity: normal

The grub manual says that the return statement will use its argument as
the exit code of the function.  However, all non-zero exit codes seem to
get clamped to 1:

grub> function f { return 0 ; } ; f ; echo $?
0
grub> function f { return 1 ; } ; f ; echo $?
1
grub> function f { return 2 ; } ; f ; echo $?
1
grub> function f { return 42 ; } ; f ; echo $?
1

- Josh Triplett

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]        1.5.38      Debian configuration management sy
ii  grub-common                  1.99~rc1-2  GRand Unified Bootloader, version 
ii  libc6                        2.11.2-11   Embedded GNU C Library: Shared lib
ii  libdevmapper1.02.1           2:1.02.48-5 The Linux Kernel Device Mapper use
ii  ucf                          3.0025+nmu1 Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  6.0.5      common files for the Debian Deskto

-- debconf information excluded





More information about the Pkg-grub-devel mailing list