Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteeb01eb

Browse files
committed
Remove pointless error-code checking in pg_dump/parallel.c.
Commitfe27009 tried to make parallel.c's Windows implementation ofpiperead() translate Windows socket errors to Unix, but that didn'tactually work because TranslateSocketError() is backend-internal code(and not even public there). But on closer inspection, the solecaller of this function doesn't actually care whether the result iszero or negative, much less inspect the errno. So the whole exerciseis totally useless, and has been since this code was introduced.Rip it out and just call recv() directly.Per buildfarm.Discussion:https://postgr.es/m/2621622.1602184554@sss.pgh.pa.us
1 parent961e07b commiteeb01eb

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

‎src/bin/pg_dump/parallel.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ typedef struct
130130

131131
/* Windows implementation of pipe access */
132132
staticintpgpipe(inthandles[2]);
133-
staticintpiperead(ints,char*buf,intlen);
133+
#definepiperead(a,b,c)recv(a,b,c,0)
134134
#definepipewrite(a,b,c)send(a,b,c,0)
135135

136136
#else/* !WIN32 */
@@ -1817,25 +1817,4 @@ pgpipe(int handles[2])
18171817
return0;
18181818
}
18191819

1820-
/*
1821-
* Windows implementation of reading from a pipe.
1822-
*/
1823-
staticint
1824-
piperead(ints,char*buf,intlen)
1825-
{
1826-
intret=recv(s,buf,len,0);
1827-
1828-
if (ret<0)
1829-
{
1830-
switch (TranslateSocketError())
1831-
{
1832-
caseALL_CONNECTION_FAILURE_ERRNOS:
1833-
/* Treat connection loss as EOF on the pipe */
1834-
ret=0;
1835-
break;
1836-
}
1837-
}
1838-
returnret;
1839-
}
1840-
18411820
#endif/* WIN32 */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp