diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-01-18 22:55:23 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-01-18 22:55:23 +0000 |
commit | c27357906a339eb55e600efc71aef3f7617cb277 (patch) | |
tree | 27bbd0024904cca7346b866337bbb8d7ad1a1ec9 /linux-user | |
parent | 985a19d6d1d7ab3705bf42698cc95abfbbfa24f8 (diff) |
avoid exiting directly if file not found
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@567 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/elfload.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index f2970f88df..71055255c3 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1284,14 +1284,9 @@ int elf_exec(const char * filename, char ** argv, char ** envp, for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */ bprm.page[i] = 0; retval = open(filename, O_RDONLY); - if (retval == -1) { - perror(filename); - exit(-1); - /* return retval; */ - } - else { - bprm.fd = retval; - } + if (retval < 0) + return retval; + bprm.fd = retval; bprm.filename = (char *)filename; bprm.sh_bang = 0; bprm.loader = 0; |