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

Commite921ff1

Browse files
committed
Back out socket path until it works.
1 parentc8b9b14 commite921ff1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/include/libpq/pqcomm.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $Id: pqcomm.h,v 1.47 2000/11/22 02:38:25 momjian Exp $
12+
* $Id: pqcomm.h,v 1.48 2000/11/22 02:47:30 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -51,16 +51,17 @@ typedef union SockAddr
5151
/* Configure the UNIX socket address for the well known port. */
5252

5353
#if defined(SUN_LEN)
54+
#defineUNIXSOCK_PATH(sun,port,defpath) \
55+
((defpath && defpath[0] != '\0') ? (strncpy((sun).sun_path, defpath, sizeof((sun).sun_path)), (sun).sun_path[sizeof((sun).sun_path)-1] = '\0') : sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)))
5456
#defineUNIXSOCK_LEN(sun) \
5557
(SUN_LEN(&(sun)))
5658
#else
59+
#defineUNIXSOCK_PATH(sun,port,defpath) \
60+
((defpath && defpath[0] != '\0') ? (strncpy((sun).sun_path, defpath, sizeof((sun).sun_path)), (sun).sun_path[sizeof((sun).sun_path)-1] = '\0') : sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)))
5761
#defineUNIXSOCK_LEN(sun) \
5862
(strlen((sun).sun_path)+ offsetof(struct sockaddr_un, sun_path))
5963
#endif
6064

61-
#defineUNIXSOCK_PATH(sun,port,defpath) \
62-
(snprintf((sun).sun_path, UNIXSOCK_LEN(sun), "/tmp/.s.PGSQL.%d", (port)))
63-
6465
/*
6566
*We do this because sun_len is in BSD's struct, while others don't.
6667
*We never actually set BSD's sun_len, and I can't think of a

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp