From 008abac082f1c098d402f944d9287dce67ffce0a Mon Sep 17 00:00:00 2001 From: Mike Chan Date: Mon, 29 Jun 2009 20:30:55 -0700 Subject: [PATCH] init now returns proper error codes in dmesg for write command (init.rc) Signed-off-by: Mike Chan --- init/builtins.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/builtins.c b/init/builtins.c index 93ce6e8b8..16601ce0c 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -49,7 +49,7 @@ static int write_file(const char *path, const char *value) fd = open(path, O_WRONLY|O_CREAT, 0622); if (fd < 0) - return -1; + return -errno; len = strlen(value); @@ -59,7 +59,7 @@ static int write_file(const char *path, const char *value) close(fd); if (ret < 0) { - return -1; + return -errno; } else { return 0; }