On Wednesday 05 April 2006 18:05, D. Bahi wrote: > Blaisorblade wrote: > > On Wednesday 05 April 2006 05:59, D. Bahi wrote: > >> Jeff Dike wrote:
> it doesn't eat the umid= arg (no uml_utilities on the host?) > not_dead_yet : couldn't open pid file > '/home/rtrsvcs/dbahi/.uml/happy/pid', err = 1 > Failed to create 'happy' - err = -17 > Failed to initialize umid "happy", trying with a random umid Update - I can get this by creating ~/.uml/<umid>. This will trigger the above failure. rm -rf ~/.uml (when the machines are off) will solve the umid problem, or rm -rf ~/.uml/<the umid you need>. The patch attached (untested) should fix the problems, will report back when it'll be tested. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade
Index: linux-2.6.git/arch/um/os-Linux/umid.c =================================================================== --- linux-2.6.git.orig/arch/um/os-Linux/umid.c +++ linux-2.6.git/arch/um/os-Linux/umid.c @@ -120,7 +120,8 @@ static int not_dead_yet(char *dir) dead = 0; fd = open(file, O_RDONLY); - if(fd < 0){ + if(fd < 0) { + fd = -errno; if(fd != -ENOENT){ printk("not_dead_yet : couldn't open pid file '%s', " "err = %d\n", file, -fd); @@ -130,9 +131,13 @@ static int not_dead_yet(char *dir) err = 0; n = read(fd, pid, sizeof(pid)); - if(n <= 0){ + if(n < 0){ + printk("not_dead_yet : couldn't read pid file '%s', " + "err = %d\n", file, errno); + goto out_close; + } else if(n == 0){ printk("not_dead_yet : couldn't read pid file '%s', " - "err = %d\n", file, -n); + "0-byte read\n", file); goto out_close; } @@ -155,9 +160,9 @@ static int not_dead_yet(char *dir) return err; - out_close: +out_close: close(fd); - out: +out: return 0; }