Rev 4543 | Rev 4617 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4543 | Rev 4544 | ||
---|---|---|---|
Line 81... | Line 81... | ||
81 | closeall(); |
81 | closeall(); |
82 | 82 | ||
83 | stdin = fopen(argv[1], "r"); |
83 | stdin = fopen(argv[1], "r"); |
84 | stdout = fopen(argv[1], "w"); |
84 | stdout = fopen(argv[1], "w"); |
85 | stderr = fopen(argv[1], "w"); |
85 | stderr = fopen(argv[1], "w"); |
- | 86 | ||
- | 87 | /* |
|
- | 88 | * FIXME: fopen() should actually detect that we are opening a console |
|
- | 89 | * and it should set line-buffering mode automatically. |
|
- | 90 | */ |
|
- | 91 | setvbuf(stdout, NULL, _IOLBF, BUFSIZ); |
|
86 | 92 | ||
87 | if ((stdin == NULL) |
93 | if ((stdin == NULL) |
88 | || (stdout == NULL) |
94 | || (stdout == NULL) |
89 | || (stderr == NULL)) |
95 | || (stderr == NULL)) |
90 | return -2; |
96 | return -2; |
91 | 97 | ||
92 | version_print(argv[1]); |
98 | version_print(argv[1]); |
93 | fflush(stdout); |
- | |
94 | task_id_t id = spawn(argv[2]); |
99 | task_id_t id = spawn(argv[2]); |
95 | task_wait(id); |
100 | task_wait(id); |
96 | 101 | ||
97 | return 0; |
102 | return 0; |
98 | } |
103 | } |