1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

Move find_my_exec() way up into main.c so it is available to the

timezone code and other places.

Remove elog() calls from find_my_exec;  do fprintf(stderr) instead.  We
can then remove the exec.c handling in the makefile because it doesn't
have to be built to suppress elog calls.
This commit is contained in:
Bruce Momjian
2004-05-18 20:18:59 +00:00
parent da401bd314
commit a9fad44372
10 changed files with 92 additions and 116 deletions

View File

@ -10,17 +10,13 @@
* must be replaced with recv/send.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/pipe.c,v 1.3 2004/05/11 21:57:15 momjian Exp $
* $PostgreSQL: pgsql/src/port/pipe.c,v 1.4 2004/05/18 20:18:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include <sys/wait.h>
#define _(x) gettext((x))
#ifdef WIN32
int
pgpipe(int handles[2])
@ -70,40 +66,3 @@ int piperead(int s, char* buf, int len)
}
#endif
/*
* pclose() plus useful error reporting
* Is this necessary? bjm 2004-05-11
*/
int
pclose_check(FILE *stream)
{
int exitstatus;
exitstatus = pclose(stream);
if (exitstatus == 0)
return 0; /* all is well */
if (exitstatus == -1)
{
/* pclose() itself failed, and hopefully set errno */
perror("pclose failed");
}
else if (WIFEXITED(exitstatus))
{
fprintf(stderr, _("child process exited with exit code %d\n"),
WEXITSTATUS(exitstatus));
}
else if (WIFSIGNALED(exitstatus))
{
fprintf(stderr, _("child process was terminated by signal %d\n"),
WTERMSIG(exitstatus));
}
else
{
fprintf(stderr, _("child process exited with unrecognized status %d\n"),
exitstatus);
}
return -1;
}