Skip to content

Commit 7c23bfd

Browse files
committed
Sprinkle some const decorations
This might help clarify the API a bit.
1 parent 7ca8c97 commit 7c23bfd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/backend/libpq/pqcomm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ static int internal_putbytes(const char *s, size_t len);
166166
static int internal_flush(void);
167167

168168
#ifdef HAVE_UNIX_SOCKETS
169-
static int Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath);
170-
static int Setup_AF_UNIX(char *sock_path);
169+
static int Lock_AF_UNIX(const char *unixSocketDir, const char *unixSocketPath);
170+
static int Setup_AF_UNIX(const char *sock_path);
171171
#endif /* HAVE_UNIX_SOCKETS */
172172

173173
static const PQcommMethods PqCommSocketMethods = {
@@ -327,8 +327,8 @@ socket_close(int code, Datum arg)
327327
*/
328328

329329
int
330-
StreamServerPort(int family, char *hostName, unsigned short portNumber,
331-
char *unixSocketDir,
330+
StreamServerPort(int family, const char *hostName, unsigned short portNumber,
331+
const char *unixSocketDir,
332332
pgsocket ListenSocket[], int MaxListen)
333333
{
334334
pgsocket fd;
@@ -611,7 +611,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
611611
* Lock_AF_UNIX -- configure unix socket file path
612612
*/
613613
static int
614-
Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath)
614+
Lock_AF_UNIX(const char *unixSocketDir, const char *unixSocketPath)
615615
{
616616
/*
617617
* Grab an interlock file associated with the socket file.
@@ -642,7 +642,7 @@ Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath)
642642
* Setup_AF_UNIX -- configure unix socket permissions
643643
*/
644644
static int
645-
Setup_AF_UNIX(char *sock_path)
645+
Setup_AF_UNIX(const char *sock_path)
646646
{
647647
/*
648648
* Fix socket ownership/permission if requested. Note we must do this

src/include/libpq/libpq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ extern const PGDLLIMPORT PQcommMethods *PqCommMethods;
5555
*/
5656
extern WaitEventSet *FeBeWaitSet;
5757

58-
extern int StreamServerPort(int family, char *hostName,
59-
unsigned short portNumber, char *unixSocketDir,
58+
extern int StreamServerPort(int family, const char *hostName,
59+
unsigned short portNumber, const char *unixSocketDir,
6060
pgsocket ListenSocket[], int MaxListen);
6161
extern int StreamConnection(pgsocket server_fd, Port *port);
6262
extern void StreamClose(pgsocket sock);

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