From 89d485870527e58b4a1cd1af1efc617f882b3a3d Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 3 Jun 2009 16:36:21 +0000 Subject: [PATCH] Fix errors, and return Unix-based gvpr usage back to pipes until the library is done. --- cmd/smyrna/gvprpipe.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cmd/smyrna/gvprpipe.c b/cmd/smyrna/gvprpipe.c index add2214c9..41be919b7 100644 --- a/cmd/smyrna/gvprpipe.c +++ b/cmd/smyrna/gvprpipe.c @@ -27,6 +27,7 @@ #else #include #include +#include #endif #include @@ -254,16 +255,15 @@ exec_gvpr(Agraph_t* srcGraph, char* filename) CloseHandle(piProcInfo.hProcess); CloseHandle(piProcInfo.hThread); #else - pp = popen (agxbuse (&xbuf), "rw"); - if (!pp) - { -// printf ("error #:%d\n",errno); - exit(1); - } + pp = popen (agxbuse (&xbuf), "r+"); + if (!pp) { + fprintf (stderr, "error #:%d\n",errno); + exit(1); + } agwrite(srcGraph, pp); G = agread(pp, NULL) ; - _pclose (pp); + pclose (pp); unlink (filename); #endif @@ -338,7 +338,11 @@ extern Agraph_t* execGVPR(Agraph_t* srcG, char* prg); static int apply_gvpr(Agraph_t* g,char* prog) { +#ifdef WIN32 Agraph_t* tempg = execGVPR (g, prog); +#else + Agraph_t* tempg = exec_gvpr (g, prog); +#endif if ((tempg) &&(gtk_toggle_button_get_active((GtkToggleButton *) glade_xml_get_widget(xml, "GtkCheckButton")))) { -- 2.40.0