Changeset 6ea9a1d in mainline for uspace/app/bdsh/cmds/mod_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/mod_cmds.c

    rae45201 r6ea9a1d  
    124124/* Invokes the module entry point modules[module], passing argv[] as an argument
    125125 * stack. */
    126 int run_module(int module, char *argv[])
     126int run_module(int module, char *argv[], iostate_t *new_iostate)
    127127{
     128        int rc;
    128129        module_t *mod = modules;
    129130
    130131        mod += module;
     132       
     133        iostate_t *old_iostate = get_iostate();
     134        set_iostate(new_iostate);
    131135
    132         if (NULL != mod->entry)
    133                 return ((int)mod->entry(argv));
     136        if (NULL != mod->entry) {
     137                rc = ((int)mod->entry(argv));
     138        }
     139        else {
     140                rc = CL_ENOENT;
     141        }
     142       
     143        set_iostate(old_iostate);
    134144
    135         return CL_ENOENT;
     145        return rc;
    136146}
Note: See TracChangeset for help on using the changeset viewer.