Move some functions around to improve overall structure
[lttv.git] / lttv / modules / text / sync_chain_batch.c
index 55ec91056f6397c1b8e1e997204e072136165946..c88b13c5962623fdf3491829d9e1c0bf4f91ae8a 100644 (file)
@@ -295,35 +295,10 @@ void setupSyncChain(LttvTracesetContext* const traceSetContext)
 
        if (optionEvalGraphs)
        {
-               char* cwd;
-               int graphsFp;
-
                // Create the graph directory right away in case the module initialization
                // functions have something to write in it.
                syncState->graphsDir= optionEvalGraphsDir;
-               cwd= changeToGraphDir(optionEvalGraphsDir);
-
-               if ((graphsFp= open("graphs.gnu", O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR |
-                               S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH
-                               | S_IWOTH | S_IXOTH)) == -1)
-               {
-                       g_error(strerror(errno));
-               }
-               if ((syncState->graphsStream= fdopen(graphsFp, "w")) == NULL)
-               {
-                       g_error(strerror(errno));
-               }
-
-               fprintf(syncState->graphsStream,
-                       "#!/usr/bin/gnuplot\n\n"
-                       "set terminal postscript eps color size 8in,6in\n");
-
-               retval= chdir(cwd);
-               if (retval == -1)
-               {
-                       g_error(strerror(errno));
-               }
-               free(cwd);
+               syncState->graphsStream= createGraphsDir(syncState->graphsDir);
        }
        else
        {
This page took 0.022714 seconds and 4 git commands to generate.