Changeset 27255 for trunk/Ohana
- Timestamp:
- Mar 11, 2010, 12:45:59 PM (16 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 added
- 6 edited
-
cmd.basic/Makefile (modified) (1 diff)
-
cmd.basic/init.c (modified) (2 diffs)
-
cmd.basic/opihi.c (added)
-
include/shell.h (modified) (1 diff)
-
lib.shell/command.c (modified) (4 diffs)
-
lib.shell/gprint.c (modified) (2 diffs)
-
pantasks/test/threadload.sh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/Makefile
r26891 r27255 40 40 $(SRC)/module.$(ARCH).o \ 41 41 $(SRC)/nop.$(ARCH).o \ 42 $(SRC)/opihi.$(ARCH).o \ 42 43 $(SRC)/output.$(ARCH).o \ 43 44 $(SRC)/quit.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.basic/init.c
r26891 r27255 26 26 int module PROTO((int, char **)); 27 27 int nop PROTO((int, char **)); 28 int opihi_setmode PROTO((int, char **)); 28 29 int output PROTO((int, char **)); 29 30 int pwd PROTO((int, char **)); … … 74 75 {1, "module", module, "load script file from the modules directories"}, 75 76 {1, "nop", nop, "a NOP function"}, 77 {1, "opihi", opihi_setmode, "get / set opihi behavior options"}, 76 78 {1, "output", output, "redirect output to file"}, 77 79 {1, "pwd", pwd, "print current working directory"}, -
trunk/Ohana/src/opihi/include/shell.h
r23530 r27255 70 70 71 71 int command PROTO((char *line, char **outline, int VERBOSE)); 72 void set_verbose_shell PROTO((int mode)); 73 int get_verbose_shell PROTO((void)); 74 72 75 char *expand_vars PROTO((char *line)); 73 76 char *expand_vectors PROTO((char *line)); -
trunk/Ohana/src/opihi/lib.shell/command.c
r25440 r27255 1 1 # include "opihi.h" 2 2 # define DEBUG 0 3 4 static int VERBOSE_SHELL = FALSE; 3 5 4 6 int command (char *line, char **outline, int VERBOSE) { … … 29 31 *outline = line; 30 32 31 # if (DEBUG) 32 fprintf (stderr, "line: %s\n", line); 33 # endif 33 if (VERBOSE_SHELL) gprint (GP_ERR, "opihi: %s\n", line); 34 34 35 35 argv = parse_commands (line, &argc); … … 60 60 msg = get_variable_ptr ("ERRORMSG"); 61 61 if (msg != (char *) NULL) gprint (GP_ERR, "%s\n", msg); 62 //gprint (GP_ERR, "error on line: %s\n", rawline);62 if (VERBOSE_SHELL) gprint (GP_ERR, "error on line: %s\n", rawline); 63 63 } 64 64 … … 73 73 } 74 74 75 void set_verbose_shell(int mode) { 76 VERBOSE_SHELL = mode; 77 } 78 79 int get_verbose_shell(void) { 80 return VERBOSE_SHELL; 81 } 82 83 84 75 85 /* parse the input line, search for the corresponding command, and execute it 76 86 if no match is found, return -1; this is used above to distinguish between -
trunk/Ohana/src/opihi/lib.shell/gprint.c
r24028 r27255 305 305 if (stream[0].mode == GP_FILE) { 306 306 status = vfprintf (stream[0].file, format, argp); 307 fflush (stream[0].file); 307 308 if (status < 0) { 308 309 return (FALSE); … … 325 326 if (stream[0].mode == GP_FILE) { 326 327 fwrite (buffer, size, N, stream[0].file); 328 fflush (stream[0].file); 327 329 } else { 328 330 // XXX can we not use exising IOBuffer APIs here? -
trunk/Ohana/src/opihi/pantasks/test/threadload.sh
r23530 r27255 31 31 # default exit status 32 32 task.exit default 33 echo "basic: exit status: $ EXIT"33 echo "basic: exit status: $JOB_STATUS" 34 34 end 35 35 … … 65 65 # default exit status 66 66 task.exit default 67 echo "basic: exit status: $ EXIT"67 echo "basic: exit status: $JOB_STATUS" 68 68 end 69 69 … … 99 99 # default exit status 100 100 task.exit default 101 echo "basic: exit status: $ EXIT"101 echo "basic: exit status: $JOB_STATUS" 102 102 end 103 103
Note:
See TracChangeset
for help on using the changeset viewer.
