Changeset bb9ec2d in mainline for uspace/app
- Timestamp:
- 2017-03-07T20:47:35Z (9 years ago)
- 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)
- Location:
- uspace/app
- Files:
-
- 2 edited
-
bdsh/exec.c (modified) (2 diffs)
-
trace/trace.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/exec.c
re796dc8 rbb9ec2d 101 101 char *tmp; 102 102 int rc, retval, i; 103 int file_handles[3]; 104 int *file_handles_p[4]; 103 int file_handles[3] = { -1, -1, -1 }; 105 104 FILE *files[3]; 106 105 … … 113 112 114 113 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]); 121 115 } 122 file_handles_p[i] = NULL;123 116 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]); 125 119 free(tmp); 126 120 -
uspace/app/trace/trace.c
re796dc8 rbb9ec2d 513 513 514 514 /* Send program pathname */ 515 rc = loader_set_p athname(ldr, path);515 rc = loader_set_program_path(ldr, path); 516 516 if (rc != EOK) 517 517 goto error; … … 523 523 524 524 /* Send default files */ 525 int *files[4];526 525 int fd_stdin; 527 526 int fd_stdout; 528 527 int fd_stderr; 529 528 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 551 547 /* Load the program. */ 552 548 rc = loader_load_program(ldr);
Note:
See TracChangeset
for help on using the changeset viewer.
