aboutsummaryrefslogtreecommitdiff
path: root/linux-user/linuxload.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-10-19 20:28:22 +0200
committerAurelien Jarno <aurelien@aurel32.net>2012-10-19 20:28:22 +0200
commit41a05a457620539f84950c2f52293963388275b0 (patch)
tree483f329622449207630014dd030ff94ebfed5e4e /linux-user/linuxload.c
parent3e50da65255bf4026b15e71299f4a5a40382a057 (diff)
parentae017a5b95962f68ece21065376cd3266998fd02 (diff)
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu
* 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu: linux-user: register align p{read, write}64 linux-user: ppc: mark as long long aligned tcg: Remove TCG_TARGET_HAS_GUEST_BASE define configure: Remove unnecessary host_guest_base code linux-user: If loading fails, print error as string, not number linux-user: Fix siginfo handling alpha-linux-user: Fix sigaltstack structure definition linux-user: Implement gethostname linux-user: Perform more checks on iovec lists linux-user: fix multi-threaded /proc/self/maps linux-user: fix statfs
Diffstat (limited to 'linux-user/linuxload.c')
-rw-r--r--linux-user/linuxload.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c
index b47025f08a..381ab8914b 100644
--- a/linux-user/linuxload.c
+++ b/linux-user/linuxload.c
@@ -140,8 +140,9 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
bprm->p = TARGET_PAGE_SIZE*MAX_ARG_PAGES-sizeof(unsigned int);
memset(bprm->page, 0, sizeof(bprm->page));
retval = open(filename, O_RDONLY);
- if (retval < 0)
- return retval;
+ if (retval < 0) {
+ return -errno;
+ }
bprm->fd = retval;
bprm->filename = (char *)filename;
bprm->argc = count(argv);
@@ -165,8 +166,7 @@ int loader_exec(const char * filename, char ** argv, char ** envp,
retval = load_flt_binary(bprm,regs,infop);
#endif
} else {
- fprintf(stderr, "Unknown binary format\n");
- return -1;
+ return -ENOEXEC;
}
}