Changeset bb9ec2d in mainline for uspace/app


Ignore:
Timestamp:
2017-03-07T20:47:35Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a737667e
Parents:
e796dc8
git-author:
Jiri Zarevucky <zarevucky.jiri@…> (2017-03-07 20:47:35)
git-committer:
Jakub Jermar <jakub@…> (2017-03-07 20:47:35)
Message:

Merge from lp:~zarevucky-jiri/helenos/vfs-2.5/ revision 1941-1944

Original commit messages:

1944: Jiri Zarevucky 2013-08-06 Replace legacy file descriptor presetting with inbox.
1943: Jiri Zarevucky 2013-08-06 Do not preserve open state when passing file descriptor to another task. Allow receiver to specify, whether the descriptor is low or high.
1942: Jiri Zarevucky 2013-08-06 C style.
1941: Jiri Zarevucky 2013-08-06 Make loader accept file reference instead of a pathname.

Modifications:

  • Keep version of elf_load_file() that accepts file name
  • Changes required for loading dynamically linked executables
  • Update to newer list_foreach
Location:
uspace/app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/exec.c

    re796dc8 rbb9ec2d  
    101101        char *tmp;
    102102        int rc, retval, i;
    103         int file_handles[3];
    104         int *file_handles_p[4];
     103        int file_handles[3] = { -1, -1, -1 };
    105104        FILE *files[3];
    106105
     
    113112       
    114113        for (i = 0; i < 3 && files[i] != NULL; i++) {
    115                 if (vfs_fhandle(files[i], &file_handles[i]) == EOK) {
    116                         file_handles_p[i] = &file_handles[i];
    117                 }
    118                 else {
    119                         file_handles_p[i] = NULL;
    120                 }
     114                vfs_fhandle(files[i], &file_handles[i]);
    121115        }
    122         file_handles_p[i] = NULL;
    123116
    124         rc = task_spawnvf(&tid, &twait, tmp, (const char **) argv, file_handles_p);
     117        rc = task_spawnvf(&tid, &twait, tmp, (const char **) argv,
     118            file_handles[0], file_handles[1], file_handles[2]);
    125119        free(tmp);
    126120
  • uspace/app/trace/trace.c

    re796dc8 rbb9ec2d  
    513513
    514514        /* Send program pathname */
    515         rc = loader_set_pathname(ldr, path);
     515        rc = loader_set_program_path(ldr, path);
    516516        if (rc != EOK)
    517517                goto error;
     
    523523
    524524        /* Send default files */
    525         int *files[4];
    526525        int fd_stdin;
    527526        int fd_stdout;
    528527        int fd_stderr;
    529528       
    530         if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK))
    531                 files[0] = &fd_stdin;
    532         else
    533                 files[0] = NULL;
    534        
    535         if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK))
    536                 files[1] = &fd_stdout;
    537         else
    538                 files[1] = NULL;
    539        
    540         if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK))
    541                 files[2] = &fd_stderr;
    542         else
    543                 files[2] = NULL;
    544        
    545         files[3] = NULL;
    546        
    547         rc = loader_set_files(ldr, files);
    548         if (rc != EOK)
    549                 goto error;
    550 
     529        if ((stdin != NULL) && (vfs_fhandle(stdin, &fd_stdin) == EOK)) {
     530                rc = loader_add_inbox(ldr, "stdin", fd_stdin);
     531                if (rc != EOK)
     532                        goto error;
     533        }
     534       
     535        if ((stdout != NULL) && (vfs_fhandle(stdout, &fd_stdout) == EOK)) {
     536                rc = loader_add_inbox(ldr, "stdout", fd_stdout);
     537                if (rc != EOK)
     538                        goto error;
     539        }
     540       
     541        if ((stderr != NULL) && (vfs_fhandle(stderr, &fd_stderr) == EOK)) {
     542                rc = loader_add_inbox(ldr, "stderr", fd_stderr);
     543                if (rc != EOK)
     544                        goto error;
     545        }
     546       
    551547        /* Load the program. */
    552548        rc = loader_load_program(ldr);
Note: See TracChangeset for help on using the changeset viewer.