From f1c445fd1fbd6a0decda3021b584e2db4b7383ee Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Mon, 10 Apr 2006 22:53:38 -0700 Subject: [PATCH] --- yaml --- r: 25475 b: refs/heads/master c: d84a19ce52a7b01dc7318ea3a8223dfe44cccb6f h: refs/heads/master i: 25473: 6b60f46d48b0109e557b1bf0072b831e32c5fdf1 25471: 7f3839ed8b2106ec947426a34adde3f4eddabacd v: v3 --- [refs] | 2 +- trunk/arch/um/os-Linux/umid.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 8ab18f4f6235..fcf65231fec7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1c332c9e813cbee6ca77c3a66ee4d312eb96770 +refs/heads/master: d84a19ce52a7b01dc7318ea3a8223dfe44cccb6f diff --git a/trunk/arch/um/os-Linux/umid.c b/trunk/arch/um/os-Linux/umid.c index 198e59163288..34bfc1bb9e38 100644 --- a/trunk/arch/um/os-Linux/umid.c +++ b/trunk/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; }