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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user