Changeset 6ea9a1d in mainline for uspace/app/bdsh/cmds
- Timestamp:
- 2011-06-11T22:32:24Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36ab7c7
- Parents:
- ae45201
- Location:
- uspace/app/bdsh/cmds
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/builtin_cmds.c
rae45201 r6ea9a1d 38 38 #include "cmds.h" 39 39 #include "builtin_aliases.h" 40 #include "scli.h" 40 41 41 42 extern volatile unsigned int cli_interactive; … … 101 102 } 102 103 103 int run_builtin(int builtin, char *argv[], cliuser_t *usr )104 int run_builtin(int builtin, char *argv[], cliuser_t *usr, iostate_t *new_iostate) 104 105 { 106 int rc; 105 107 builtin_t *cmd = builtins; 106 108 107 109 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); 108 122 109 if (NULL != cmd->entry) 110 return((int)cmd->entry(argv, usr)); 111 112 return CL_ENOENT; 123 return rc; 113 124 } -
uspace/app/bdsh/cmds/cmds.h
rae45201 r6ea9a1d 59 59 extern char *alias_for_module(const char *); 60 60 extern int help_module(int, unsigned int); 61 extern int run_module(int, char *[] );61 extern int run_module(int, char *[], iostate_t *); 62 62 63 63 /* Prototypes for builtin launchers */ … … 67 67 extern char *alias_for_builtin(const char *); 68 68 extern int help_builtin(int, unsigned int); 69 extern int run_builtin(int, char *[], cliuser_t * );69 extern int run_builtin(int, char *[], cliuser_t *, iostate_t *); 70 70 71 71 #endif -
uspace/app/bdsh/cmds/mod_cmds.c
rae45201 r6ea9a1d 124 124 /* Invokes the module entry point modules[module], passing argv[] as an argument 125 125 * stack. */ 126 int run_module(int module, char *argv[] )126 int run_module(int module, char *argv[], iostate_t *new_iostate) 127 127 { 128 int rc; 128 129 module_t *mod = modules; 129 130 130 131 mod += module; 132 133 iostate_t *old_iostate = get_iostate(); 134 set_iostate(new_iostate); 131 135 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); 134 144 135 return CL_ENOENT;145 return rc; 136 146 }
Note:
See TracChangeset
for help on using the changeset viewer.