mirror of
https://github.com/ipxe/ipxe
synced 2025-12-24 06:22:59 +03:00
D'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh d'oh
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user