Sprinkle some const decorations

This might help clarify the API a bit.
This commit is contained in:
Peter Eisentraut 2020-01-31 11:50:32 +01:00
parent 7ca8c9706a
commit 7c23bfd25c
2 changed files with 8 additions and 8 deletions

View File

@ -166,8 +166,8 @@ static int internal_putbytes(const char *s, size_t len);
static int internal_flush(void); static int internal_flush(void);
#ifdef HAVE_UNIX_SOCKETS #ifdef HAVE_UNIX_SOCKETS
static int Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath); static int Lock_AF_UNIX(const char *unixSocketDir, const char *unixSocketPath);
static int Setup_AF_UNIX(char *sock_path); static int Setup_AF_UNIX(const char *sock_path);
#endif /* HAVE_UNIX_SOCKETS */ #endif /* HAVE_UNIX_SOCKETS */
static const PQcommMethods PqCommSocketMethods = { static const PQcommMethods PqCommSocketMethods = {
@ -327,8 +327,8 @@ socket_close(int code, Datum arg)
*/ */
int int
StreamServerPort(int family, char *hostName, unsigned short portNumber, StreamServerPort(int family, const char *hostName, unsigned short portNumber,
char *unixSocketDir, const char *unixSocketDir,
pgsocket ListenSocket[], int MaxListen) pgsocket ListenSocket[], int MaxListen)
{ {
pgsocket fd; pgsocket fd;
@ -611,7 +611,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
* Lock_AF_UNIX -- configure unix socket file path * Lock_AF_UNIX -- configure unix socket file path
*/ */
static int static int
Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath) Lock_AF_UNIX(const char *unixSocketDir, const char *unixSocketPath)
{ {
/* /*
* Grab an interlock file associated with the socket file. * Grab an interlock file associated with the socket file.
@ -642,7 +642,7 @@ Lock_AF_UNIX(char *unixSocketDir, char *unixSocketPath)
* Setup_AF_UNIX -- configure unix socket permissions * Setup_AF_UNIX -- configure unix socket permissions
*/ */
static int static int
Setup_AF_UNIX(char *sock_path) Setup_AF_UNIX(const char *sock_path)
{ {
/* /*
* Fix socket ownership/permission if requested. Note we must do this * Fix socket ownership/permission if requested. Note we must do this

View File

@ -55,8 +55,8 @@ extern const PGDLLIMPORT PQcommMethods *PqCommMethods;
*/ */
extern WaitEventSet *FeBeWaitSet; extern WaitEventSet *FeBeWaitSet;
extern int StreamServerPort(int family, char *hostName, extern int StreamServerPort(int family, const char *hostName,
unsigned short portNumber, char *unixSocketDir, unsigned short portNumber, const char *unixSocketDir,
pgsocket ListenSocket[], int MaxListen); pgsocket ListenSocket[], int MaxListen);
extern int StreamConnection(pgsocket server_fd, Port *port); extern int StreamConnection(pgsocket server_fd, Port *port);
extern void StreamClose(pgsocket sock); extern void StreamClose(pgsocket sock);