From: Pavan D. <pav...@gm...> - 2014-07-24 04:07:57
|
Hello All, AFAICS that pgxc_ctl uses popen() at many places to execute a command and sometimes to also parse back the output. I've been chasing a bug that would cause subsequent reads on the FILE * returned by popen() to return EOF. After some investigations, it seems that the correct way to close the file descriptor returned by popen() is to use pclose() which fclose() does not reset the pipe state properly whereas pclose() does. The current XC code uses fclose() instead which probably works fine on some platforms such as Linux, but fails on other such as Mac OSX. Should we consider replacing fclose() with pclose() for pipes opened by popen()? Thanks, Pavan -- Pavan Deolasee http://www.linkedin.com/in/pavandeolasee |