MCPcopy Create free account
hub / github.com/boostorg/build / exec_cmd

Function exec_cmd

src/engine/execvms.c:101–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 */
100
101void exec_cmd
102(
103 string const * command,
104 ExecCmdCallback func,
105 void * closure,
106 LIST * shell
107)
108{
109 char * s;
110 char * e;
111 char * p;
112 int vms_status;
113 int status;
114 int rstat = EXEC_CMD_OK;
115 int exit_reason = EXIT_OK;
116 timing_info time_info;
117 timestamp start_dt;
118 struct tms start_time;
119 struct tms end_time;
120 char * cmd_string = command->value;
121
122
123 /* Start the command */
124
125 timestamp_current( &time_info.start );
126 times( &start_time );
127
128 /* See if command is more than one line discounting leading/trailing white
129 * space.
130 */
131 for ( s = cmd_string; *s && isspace( *s ); ++s );
132
133 e = p = strchr( s, '\n' );
134
135 while ( p && isspace( *p ) )
136 ++p;
137
138 /* If multi line or long, write to com file. Otherwise, exec directly. */
139 if ( ( p && *p ) || ( e - s > WRTLEN ) )
140 {
141 FILE * f;
142
143 /* Create temp file invocation. */
144
145 if ( !*commandbuf )
146 {
147 OBJECT * tmp_filename = 0;
148
149 tmp_filename = path_tmpfile();
150
151
152 /* Get tmp file name is VMS-format. */
153 {
154 string os_filename[ 1 ];
155 string_new( os_filename );
156 path_translate_to_os( object_str( tmp_filename ), os_filename );
157 object_free( tmp_filename );
158 tmp_filename = object_new( os_filename->value );

Callers

nothing calls this directly

Calls 10

timestamp_currentFunction · 0.85
path_tmpfileFunction · 0.85
string_newFunction · 0.85
path_translate_to_osFunction · 0.85
object_strFunction · 0.85
object_freeFunction · 0.85
object_newFunction · 0.85
string_freeFunction · 0.85
freeFunction · 0.85
get_statusFunction · 0.85

Tested by

no test coverage detected