backend: Get rid of sh -c for exec_string
authorErwan Velu <erwan@enovance.com>
Wed, 17 Jul 2013 20:29:27 +0000 (22:29 +0200)
committerErwan Velu <erwan@enovance.com>
Wed, 17 Jul 2013 20:29:27 +0000 (22:29 +0200)
Running commands in a 'sh -c' does kill the existing environment values.
i.e that does kill ssh-agent.

It sounds more 'direct' to execute the command in the same environment
as fio.

backend.c

index 8d16fe289c7ea814e63965e2a0da979766e26c51..c2fa34ccc7731fb3c11c280d7f887c00cd6e36d0 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1088,11 +1088,11 @@ static int keep_running(struct thread_data *td)
 
 static int exec_string(const char *string)
 {
-       int ret, newlen = strlen(string) + 1 + 8;
+       int ret, newlen = strlen(string) + 1 + 2;
        char *str;
 
        str = malloc(newlen);
-       sprintf(str, "sh -c %s", string);
+       sprintf(str, "%s", string);
 
        ret = system(str);
        if (ret == -1)