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

Commitbaac6f9

Browse files
committed
Exit cleanups I made yesterday caused pq_close() to be
invoked during exit from a standalone backend, leading to core dump.This is the cause of the recently reported initdb-time crash :-(.Sorry folks...
1 parent66f6634 commitbaac6f9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/backend/libpq/pqcomm.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* Copyright (c) 1994, Regents of the University of California
3030
*
31-
*$Id: pqcomm.c,v 1.80 1999/07/17 20:17:03 momjian Exp $
31+
*$Id: pqcomm.c,v 1.81 1999/07/23 03:00:10 tgl Exp $
3232
*
3333
*-------------------------------------------------------------------------
3434
*/
@@ -134,12 +134,16 @@ pq_getport(void)
134134

135135
/* --------------------------------
136136
*pq_close - shutdown libpq at backend exit
137+
*
138+
* Note: in a standalone backend MyProcPort will be null,
139+
* don't crash during exit...
137140
* --------------------------------
138141
*/
139142
void
140143
pq_close(void)
141144
{
142-
close(MyProcPort->sock);
145+
if (MyProcPort!=NULL)
146+
close(MyProcPort->sock);
143147
}
144148

145149

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp