mirror of https://github.com/ipxe/ipxe.git
D'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh
parent
cc697eeb1f
commit
a77b32aaf6
|
@ -119,9 +119,12 @@ static int split_args ( char *args, char * argv[] ) {
|
||||||
* Execute the named command and arguments.
|
* Execute the named command and arguments.
|
||||||
*/
|
*/
|
||||||
int system ( const char *command ) {
|
int system ( const char *command ) {
|
||||||
char *args = strdup ( command );
|
char *args;
|
||||||
int argc;
|
int argc;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
/* Obtain temporary modifiable copy of command line */
|
||||||
|
args = strdup ( command );
|
||||||
if ( ! args )
|
if ( ! args )
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -134,6 +137,9 @@ int system ( const char *command ) {
|
||||||
|
|
||||||
split_args ( args, argv );
|
split_args ( args, argv );
|
||||||
argv[argc] = NULL;
|
argv[argc] = NULL;
|
||||||
return execv ( argv[0], argv );
|
rc = execv ( argv[0], argv );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free ( args );
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue