--- gmimms-0.0.9.old/src/backend-operations.c +++ gmimms-0.0.9/src/backend-operations.c @@ -683,7 +683,7 @@ snprintf(timer, SIZE, ""); } - printf("%s %s \"%s\" \"%s\"\n", mimms_parameters.path_to_mimms, timer, mimms_parameters.url, mimms_parameters.output_file); + printf("%s %s --output \"%s\" \"%s\"\n", mimms_parameters.path_to_mimms, timer, mimms_parameters.output_file, mimms_parameters.url); /* create pipes. pipes[0] = read; pipes[1] = write*/ if(pipe(child_data.pipes) == -1) @@ -730,6 +730,18 @@ /* child */ if(child_data.child_pid == 0) { + char *xpb = mimms_parameters.url; + char *xpe; + while ((*xpb == ' ') || (*xpb == '\t')) xpb++; + + for (xpe = xpb; *xpe != '\0'; xpe++) + { + if ((*xpe == ' ') || (*xpe == '\t')) + { + *xpe = '\0'; break; + } + } + sleep(5); dup2(child_data.pipes[1], 1); @@ -737,7 +749,7 @@ fcntl(child_data.pipes[0], F_SETFL, O_NDELAY); /* execute mimms with params */ - execlp(mimms_parameters.path_to_mimms, timer, "-c", mimms_parameters.url, mimms_parameters.output_file, NULL); + execlp (mimms_parameters.path_to_mimms, timer, "--output", mimms_parameters.output_file, xpb, NULL); exit(0); }