Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/os/helenos.c

    rce04ea44 r6afc9d7  
    4141#include <stdio.h>
    4242#include <task.h>
     43#include <fcntl.h>
    4344#include <fibril_synch.h>
    44 #include <vfs/vfs.h>
    4545#include "../internal.h"
    4646
     
    161161        char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE];
    162162        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);
    164164        if (tempfile < 0) {
    165165                pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to create temporary file.", NULL, NULL);
     
    169169        char test_number_argument[MAX_TEST_NUMBER_WIDTH];
    170170        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;
    171178
    172179        const char *const arguments[3] = {
     
    179186
    180187        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);
    183189        if (rc != EOK) {
    184190                status = TEST_OUTCOME_ERROR;
     
    214220        fibril_mutex_unlock(&forced_termination_mutex);
    215221
    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);
    218223
    219224leave_close_tempfile:
    220         vfs_put(tempfile);
    221         vfs_unlink_path(tempfile_name);
     225        close(tempfile);
     226        unlink(tempfile_name);
    222227
    223228        pcut_report_test_done_unparsed(test, status, extra_output_buffer, OUTPUT_BUFFER_SIZE);
Note: See TracChangeset for help on using the changeset viewer.