Changeset 6ea9a1d in mainline for uspace/app/bdsh/cmds/builtin_cmds.c


Ignore:
Timestamp:
2011-06-11T22:32:24Z (14 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36ab7c7
Parents:
ae45201
Message:

Allow shell builtins to be redirected too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtin_cmds.c

    rae45201 r6ea9a1d  
    3838#include "cmds.h"
    3939#include "builtin_aliases.h"
     40#include "scli.h"
    4041
    4142extern volatile unsigned int cli_interactive;
     
    101102}
    102103
    103 int run_builtin(int builtin, char *argv[], cliuser_t *usr)
     104int run_builtin(int builtin, char *argv[], cliuser_t *usr, iostate_t *new_iostate)
    104105{
     106        int rc;
    105107        builtin_t *cmd = builtins;
    106108
    107109        cmd += builtin;
     110       
     111        iostate_t *old_iostate = get_iostate();
     112        set_iostate(new_iostate);
     113       
     114        if (NULL != cmd->entry) {
     115                rc = ((int)cmd->entry(argv, usr));
     116        }
     117        else {
     118                rc = CL_ENOENT;
     119        }
     120       
     121        set_iostate(old_iostate);
    108122
    109         if (NULL != cmd->entry)
    110                 return((int)cmd->entry(argv, usr));
    111 
    112         return CL_ENOENT;
     123        return rc;
    113124}
Note: See TracChangeset for help on using the changeset viewer.