Skip to content

Commit d2c1740

Browse files
committed
Remove now redundant pgpipe code.
1 parent 7313cc0 commit d2c1740

File tree

6 files changed

+10
-124
lines changed

6 files changed

+10
-124
lines changed

src/backend/port/pipe.c

Lines changed: 0 additions & 95 deletions
This file was deleted.

src/backend/postmaster/syslogger.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,9 @@ SysLoggerMain(int argc, char *argv[])
391391
}
392392
else if (rc > 0 && FD_ISSET(syslogPipe[0], &rfds))
393393
{
394-
bytesRead = piperead(syslogPipe[0],
395-
logbuffer + bytes_in_logbuffer,
396-
sizeof(logbuffer) - bytes_in_logbuffer);
394+
bytesRead = read(syslogPipe[0],
395+
logbuffer + bytes_in_logbuffer,
396+
sizeof(logbuffer) - bytes_in_logbuffer);
397397
if (bytesRead < 0)
398398
{
399399
if (errno != EINTR)
@@ -487,7 +487,7 @@ SysLogger_Start(void)
487487
#ifndef WIN32
488488
if (syslogPipe[0] < 0)
489489
{
490-
if (pgpipe(syslogPipe) < 0)
490+
if (pipe(syslogPipe) < 0)
491491
ereport(FATAL,
492492
(errcode_for_socket_access(),
493493
(errmsg("could not create pipe for syslog: %m"))));

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ segment_callback(XLogRecPtr segendpos, uint32 timeline)
162162
char xlogend[64];
163163

164164
MemSet(xlogend, 0, sizeof(xlogend));
165-
r = piperead(bgpipe[0], xlogend, sizeof(xlogend));
165+
r = read(bgpipe[0], xlogend, sizeof(xlogend));
166166
if (r < 0)
167167
{
168168
fprintf(stderr, _("%s: could not read from ready pipe: %s\n"),
@@ -270,7 +270,7 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier)
270270

271271
#ifndef WIN32
272272
/* Create our background pipe */
273-
if (pgpipe(bgpipe) < 0)
273+
if (pipe(bgpipe) < 0)
274274
{
275275
fprintf(stderr, _("%s: could not create pipe for background process: %s\n"),
276276
progname, strerror(errno));
@@ -1094,7 +1094,7 @@ BaseBackup(void)
10941094
fprintf(stderr, _("%s: waiting for background process to finish streaming...\n"), progname);
10951095

10961096
#ifndef WIN32
1097-
if (pipewrite(bgpipe[1], xlogend, strlen(xlogend)) != strlen(xlogend))
1097+
if (write(bgpipe[1], xlogend, strlen(xlogend)) != strlen(xlogend))
10981098
{
10991099
fprintf(stderr, _("%s: could not send command to background pipe: %s\n"),
11001100
progname, strerror(errno));

src/include/port.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,26 +250,7 @@ extern char *pgwin32_setlocale(int category, const char *locale);
250250
/* Portable prompt handling */
251251
extern char *simple_prompt(const char *prompt, int maxlen, bool echo);
252252

253-
/*
254-
* WIN32 doesn't allow descriptors returned by pipe() to be used in select(),
255-
* so for that platform we use socket() instead of pipe().
256-
* There is some inconsistency here because sometimes we require pg*, like
257-
* pgpipe, but in other cases we define rename to pgrename just on Win32.
258-
*/
259-
#ifndef WIN32
260-
/*
261-
* The function prototypes are not supplied because every C file
262-
* includes this file.
263-
*/
264-
#define pgpipe(a) pipe(a)
265-
#define piperead(a,b,c) read(a,b,c)
266-
#define pipewrite(a,b,c) write(a,b,c)
267-
#else
268-
extern int pgpipe(int handles[2]);
269-
extern int piperead(int s, char *buf, int len);
270-
271-
#define pipewrite(a,b,c) send(a,b,c,0)
272-
253+
#ifdef WIN32
273254
#define PG_SIGNAL_COUNT 32
274255
#define kill(pid,sig) pgkill(pid,sig)
275256
extern int pgkill(int pid, int sig);

src/port/exec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ pipe_read_line(char *cmd, char *line, int maxsize)
496496
/*
497497
* pclose() plus useful error reporting
498498
* Is this necessary? bjm 2004-05-11
499-
* It is better here because pipe.c has win32 backend linkage.
499+
* Originaally this was stated to be here because pipe.c had backend linkage.
500+
* Perhaps that's no longer so now we have got rid of pipe.c amd 2012-03-28
500501
*/
501502
int
502503
pclose_check(FILE *stream)

src/tools/msvc/Mkvcbuild.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ sub mkvcbuild
7373
$postgres->ReplaceFile('src\backend\port\pg_shmem.c','src\backend\port\win32_shmem.c');
7474
$postgres->ReplaceFile('src\backend\port\pg_latch.c','src\backend\port\win32_latch.c');
7575
$postgres->AddFiles('src\port',@pgportfiles);
76-
$postgres->AddFile('src\backend\port\pipe.c');
7776
$postgres->AddDir('src\timezone');
7877
$postgres->AddFiles('src\backend\parser','scan.l','gram.y');
7978
$postgres->AddFiles('src\backend\bootstrap','bootscanner.l','bootparse.y');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy