diff options
author | Juergen Beisert <jbe@isonoe.(none)> | 2007-10-18 18:32:02 +0200 |
---|---|---|
committer | Juergen Beisert <jbe@isonoe.(none)> | 2007-10-18 18:32:02 +0200 |
commit | 8c6c055de698753f238b3d2315f45950b2ea0528 (patch) | |
tree | 2713da08a89ebaae575597d37dcee720cabacebf /commands | |
parent | 95fc69e4e10f862a44ac9e744f98730b5ab493c0 (diff) | |
download | barebox-8c6c055de698753f238b3d2315f45950b2ea0528.tar.gz barebox-8c6c055de698753f238b3d2315f45950b2ea0528.tar.xz |
adding some useful error messages
Diffstat (limited to 'commands')
-rw-r--r-- | commands/environment.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/commands/environment.c b/commands/environment.c index 007ef4edfe..999a5f3fb4 100644 --- a/commands/environment.c +++ b/commands/environment.c @@ -33,6 +33,8 @@ #include <xfuncs.h> #include <libbb.h> #include <libgen.h> +#else +# define errno_str(x) ("void") #endif struct action_data { @@ -75,7 +77,7 @@ static int file_save_action(const char *filename, struct stat *statbuf, fd = open(filename, O_RDONLY); if (fd < 0) { - perror("open"); + printf("Open %s %s\n", filename, errno_str()); goto out; } @@ -123,7 +125,7 @@ int envfs_save(char *filename, char *dirname) envfd = open(filename, O_WRONLY | O_CREAT); if (envfd < 0) { - perror("open"); + printf("Open %s %s\n", filename, errno_str()); goto out1; } @@ -229,7 +231,7 @@ int envfs_load(char *filename, char *dir) envfd = open(filename, O_RDONLY); if (envfd < 0) { - perror("open"); + printf("Open %s %s\n", filename, errno_str()); return -1; } @@ -290,7 +292,7 @@ int envfs_load(char *filename, char *dir) fd = open(str, O_WRONLY | O_CREAT | O_TRUNC, 0644); free(str); if (fd < 0) { - perror("open"); + printf("Open %s\n", errno_str()); ret = fd; goto out; } |