diff options
-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; |