Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/exec.c

    raa8053f1 rc4a8e4a  
    4040#include <str_error.h>
    4141#include <errno.h>
     42#include <vfs/vfs.h>
    4243
    4344#include "config.h"
     
    99100        char *tmp;
    100101        int rc, retval, i;
    101         fdi_node_t file_nodes[3];
    102         fdi_node_t *file_nodes_p[4];
     102        int file_handles[3];
     103        int *file_handles_p[4];
    103104        FILE *files[3];
    104105
     
    111112       
    112113        for (i = 0; i < 3 && files[i] != NULL; i++) {
    113                 if (fnode(files[i], &file_nodes[i]) == EOK) {
    114                         file_nodes_p[i] = &file_nodes[i];
     114                if (fhandle(files[i], &file_handles[i]) == EOK) {
     115                        file_handles_p[i] = &file_handles[i];
    115116                }
    116117                else {
    117                         file_nodes_p[i] = NULL;
     118                        file_handles_p[i] = NULL;
    118119                }
    119120        }
    120         file_nodes_p[i] = NULL;
     121        file_handles_p[i] = NULL;
    121122
    122         rc = task_spawnvf(&tid, tmp, (const char **) argv, file_nodes_p);
     123        rc = task_spawnvf(&tid, tmp, (const char **) argv, file_handles_p);
    123124        free(tmp);
    124125
     
    133134                printf("%s: Failed waiting for command (%s)\n", progname,
    134135                    str_error(rc));
     136                return 1;
    135137        } else if (texit != TASK_EXIT_NORMAL) {
    136138                printf("%s: Command failed (unexpectedly terminated)\n", progname);
     139                return 1;
    137140        } else if (retval != 0) {
    138141                printf("%s: Command failed (exit code %d)\n",
    139142                    progname, retval);
     143                return 1;
    140144        }
    141145
Note: See TracChangeset for help on using the changeset viewer.