Rev 4477 | Rev 4601 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4477 | Rev 4508 | ||
---|---|---|---|
Line 77... | Line 77... | ||
77 | char **argv; |
77 | char **argv; |
78 | 78 | ||
79 | if (__pcb == NULL) { |
79 | if (__pcb == NULL) { |
80 | argc = 0; |
80 | argc = 0; |
81 | argv = NULL; |
81 | argv = NULL; |
- | 82 | stdio_init(0, NULL); |
|
82 | } else { |
83 | } else { |
83 | argc = __pcb->argc; |
84 | argc = __pcb->argc; |
84 | argv = __pcb->argv; |
85 | argv = __pcb->argv; |
85 | - | ||
86 | if (__pcb->filc > 0) |
- | |
87 | stdin = fopen_node(__pcb->filv[0], "r"); |
86 | stdio_init(__pcb->filc, __pcb->filv); |
88 | - | ||
89 | if (__pcb->filc > 1) |
- | |
90 | stdout = fopen_node(__pcb->filv[1], "w"); |
- | |
91 | - | ||
92 | if (__pcb->filc > 2) |
- | |
93 | stderr = fopen_node(__pcb->filv[2], "w"); |
- | |
94 | } |
87 | } |
95 | 88 | ||
96 | main(argc, argv); |
89 | main(argc, argv); |
97 | - | ||
98 | if (stdin != NULL) |
- | |
99 | fclose(stdin); |
- | |
100 | - | ||
101 | if (stdout != NULL) |
- | |
102 | fclose(stdout); |
- | |
103 | - | ||
104 | if (stderr != NULL) |
- | |
105 | fclose(stderr); |
90 | stdio_done(); |
106 | } |
91 | } |
107 | 92 | ||
108 | void __exit(void) |
93 | void __exit(void) |
109 | { |
94 | { |
110 | fibril_teardown(__tcb_get()->fibril_data); |
95 | fibril_teardown(__tcb_get()->fibril_data); |