Commit c27357906a339eb55e600efc71aef3f7617cb277

Authored by bellard
1 parent 985a19d6

avoid exiting directly if file not found


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@567 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 8 deletions
linux-user/elfload.c
... ... @@ -1284,14 +1284,9 @@ int elf_exec(const char * filename, char ** argv, char ** envp,
1284 1284 for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */
1285 1285 bprm.page[i] = 0;
1286 1286 retval = open(filename, O_RDONLY);
1287   - if (retval == -1) {
1288   - perror(filename);
1289   - exit(-1);
1290   - /* return retval; */
1291   - }
1292   - else {
1293   - bprm.fd = retval;
1294   - }
  1287 + if (retval < 0)
  1288 + return retval;
  1289 + bprm.fd = retval;
1295 1290 bprm.filename = (char *)filename;
1296 1291 bprm.sh_bang = 0;
1297 1292 bprm.loader = 0;
... ...