Changes in uspace/lib/pcut/src/os/helenos.c [ce04ea44:6afc9d7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/src/os/helenos.c
rce04ea44 r6afc9d7 41 41 #include <stdio.h> 42 42 #include <task.h> 43 #include <fcntl.h> 43 44 #include <fibril_synch.h> 44 #include <vfs/vfs.h>45 45 #include "../internal.h" 46 46 … … 161 161 char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE]; 162 162 snprintf(tempfile_name, PCUT_TEMP_FILENAME_BUFFER_SIZE - 1, "pcut_%lld.tmp", (unsigned long long) task_get_id()); 163 int tempfile = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE);163 int tempfile = open(tempfile_name, O_CREAT | O_RDWR); 164 164 if (tempfile < 0) { 165 165 pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to create temporary file.", NULL, NULL); … … 169 169 char test_number_argument[MAX_TEST_NUMBER_WIDTH]; 170 170 snprintf(test_number_argument, MAX_TEST_NUMBER_WIDTH, "-t%d", test->id); 171 172 int *files[4]; 173 int fd_stdin = fileno(stdin); 174 files[0] = &fd_stdin; 175 files[1] = &tempfile; 176 files[2] = &tempfile; 177 files[3] = NULL; 171 178 172 179 const char *const arguments[3] = { … … 179 186 180 187 task_wait_t test_task_wait; 181 int rc = task_spawnvf(&test_task_id, &test_task_wait, self_path, arguments, 182 fileno(stdin), tempfile, tempfile); 188 int rc = task_spawnvf(&test_task_id, &test_task_wait, self_path, arguments, files); 183 189 if (rc != EOK) { 184 190 status = TEST_OUTCOME_ERROR; … … 214 220 fibril_mutex_unlock(&forced_termination_mutex); 215 221 216 aoff64_t pos = 0; 217 vfs_read(tempfile, &pos, extra_output_buffer, OUTPUT_BUFFER_SIZE); 222 read(tempfile, extra_output_buffer, OUTPUT_BUFFER_SIZE); 218 223 219 224 leave_close_tempfile: 220 vfs_put(tempfile);221 vfs_unlink_path(tempfile_name);225 close(tempfile); 226 unlink(tempfile_name); 222 227 223 228 pcut_report_test_done_unparsed(test, status, extra_output_buffer, OUTPUT_BUFFER_SIZE);
Note:
See TracChangeset
for help on using the changeset viewer.