aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/umid.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-04-11 12:51:40 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-11 12:51:40 -0400
commit10a5fd5e6b7e2d464c9f95f67cade4ddbd63f4e1 (patch)
treeeddf856286234f28cac747d20eb59d918e1bc8b5 /arch/um/os-Linux/umid.c
parentc2a6585296009379e0f4eff39cdcb108b457ebf2 (diff)
parenta145410dccdb44f81d3b56763ef9b6f721f4e47c (diff)
Merge branch 'master'
Conflicts: drivers/scsi/libata-scsi.c include/linux/libata.h
Diffstat (limited to 'arch/um/os-Linux/umid.c')
-rw-r--r--arch/um/os-Linux/umid.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
index 198e59163288..34bfc1bb9e38 100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
@@ -120,7 +120,8 @@ static int not_dead_yet(char *dir)
120 120
121 dead = 0; 121 dead = 0;
122 fd = open(file, O_RDONLY); 122 fd = open(file, O_RDONLY);
123 if(fd < 0){ 123 if(fd < 0) {
124 fd = -errno;
124 if(fd != -ENOENT){ 125 if(fd != -ENOENT){
125 printk("not_dead_yet : couldn't open pid file '%s', " 126 printk("not_dead_yet : couldn't open pid file '%s', "
126 "err = %d\n", file, -fd); 127 "err = %d\n", file, -fd);
@@ -130,9 +131,13 @@ static int not_dead_yet(char *dir)
130 131
131 err = 0; 132 err = 0;
132 n = read(fd, pid, sizeof(pid)); 133 n = read(fd, pid, sizeof(pid));
133 if(n <= 0){ 134 if(n < 0){
135 printk("not_dead_yet : couldn't read pid file '%s', "
136 "err = %d\n", file, errno);
137 goto out_close;
138 } else if(n == 0){
134 printk("not_dead_yet : couldn't read pid file '%s', " 139 printk("not_dead_yet : couldn't read pid file '%s', "
135 "err = %d\n", file, -n); 140 "0-byte read\n", file);
136 goto out_close; 141 goto out_close;
137 } 142 }
138 143
@@ -155,9 +160,9 @@ static int not_dead_yet(char *dir)
155 160
156 return err; 161 return err;
157 162
158 out_close: 163out_close:
159 close(fd); 164 close(fd);
160 out: 165out:
161 return 0; 166 return 0;
162} 167}
163 168