Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 179b8e5

Browse files
committed
Locate the file pg_service.conf in the directory configured as --syconfdir
(i.e., /usr/local/pgsql/etc by default).
1 parent adeedf9 commit 179b8e5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/interfaces/libpq/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.42 2000/10/12 07:38:13 ishii Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.43 2000/10/17 17:43:13 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,7 +17,7 @@ NAME= pq
1717
SO_MAJOR_VERSION= 2
1818
SO_MINOR_VERSION= 1
1919

20-
CFLAGS+= -DFRONTEND -I$(srcdir)
20+
override CFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"'
2121

2222
OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
2323
pqexpbuffer.o dllist.o pqsignal.o $(SNPRINTF) $(INET_ATON)

src/interfaces/libpq/fe-connect.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.139 2000/10/17 01:00:58 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.140 2000/10/17 17:43:13 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2095,9 +2095,15 @@ pqPacketSend(PGconn *conn, const char *buf, size_t len)
20952095
return STATUS_OK;
20962096
}
20972097

2098+
2099+
2100+
#ifndef SYSCONFDIR
2101+
# error "You must compile this file with SYSCONFDIR defined."
2102+
#endif
2103+
20982104
int parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage) {
20992105
char *service = conninfo_getval(options, "service");
2100-
char *serviceFile = "/etc/pg_service.conf";
2106+
char *serviceFile = SYSCONFDIR "/pg_service.conf";
21012107
int MAXBUFSIZE = 256;
21022108
int group_found = 0;
21032109
int linenr=0, i;

0 commit comments

Comments
 (0)