Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d84a19ce authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds
Browse files

[PATCH] uml: fix failure path after conversion



Little fix for error paths in this code.

- Some bug come from conversion to os-Linux (open() doesn't follow the
  kernel -errno return convention, while the old code called os_open_file()
  which followed it).  This caused the wrong return code to be printed.

- Then be more precise about what happened and do some whitespace fixes.

Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b1c332c9
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ static int not_dead_yet(char *dir)
	dead = 0;
	fd = open(file, O_RDONLY);
	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, -n);
		       "err = %d\n", file, errno);
		goto out_close;
	} else if(n == 0){
		printk("not_dead_yet : couldn't read pid file '%s', "
		       "0-byte read\n", file);
		goto out_close;
	}