please pull git://charm.itp.tuwien.ac.at/mattems/klibc/.git maks for the change: maximilian attems: [klibc] simplify nuke fixes boot failures due to unexpected error returns usr/utils/nuke.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/usr/utils/nuke.c b/usr/utils/nuke.c index 01b300f..9470bcf 100644 --- a/usr/utils/nuke.c +++ b/usr/utils/nuke.c @@ -101,18 +101,11 @@ static int nuke(const char *what) /* It's a directory. */ err = nuke_dir(what); if (!err) - err = rmdir(what) ? errno : err; - } else { - err = errno; + rmdir(what); } } - if (err) { - fprintf(stderr, "%s: %s: %s\n", program, what, strerror(err)); - return err; - } else { - return 0; - } + return 0; } int main(int argc, char *argv[]) @@ -122,11 +115,8 @@ int main(int argc, char *argv[]) program = argv[0]; - for (i = 1; i < argc; i++) { - err = nuke(argv[i]); - if (err) - break; - } + for (i = 1; i < argc; i++) + nuke(argv[i]); - return !!err; + return 0; } -- maks
maximilian attems wrote:> please pull > git://charm.itp.tuwien.ac.at/mattems/klibc/.git maks > > for the change: > maximilian attems: > [klibc] simplify nuke > > fixes boot failures due to unexpected error returns >Looks like you completely remove all error checking; the program will exit 0 no matter what. Could you please elucidate? -hpa
On Wed, Aug 23, 2006 at 02:19:57PM -0700, H. Peter Anvin wrote:> maximilian attems wrote: > >please pull > >git://charm.itp.tuwien.ac.at/mattems/klibc/.git maks > > > >for the change: > >maximilian attems: > > [klibc] simplify nuke > > > >fixes boot failures due to unexpected error returns > > > > Looks like you completely remove all error checking; the program will > exit 0 no matter what. > > Could you please elucidate? > > -hparm -rf is not expected to return an error. we had several boot failures due to the udev initramfs script using errexit. it was after the replacement of busybox rm -rf by nuke. $ head -n 1 /usr/share/initramfs-tools/scripts/init-premount/udev #!/bin/sh -e aboves patch is based on the idea that nuke is the same as rm -rf. -- maks