]> granicus.if.org Git - postgresql/commitdiff
Locate the file pg_service.conf in the directory configured as --syconfdir
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 17 Oct 2000 17:43:13 +0000 (17:43 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 17 Oct 2000 17:43:13 +0000 (17:43 +0000)
(i.e., /usr/local/pgsql/etc by default).

src/interfaces/libpq/Makefile
src/interfaces/libpq/fe-connect.c

index 47614b181f9d508166327aabd3e2f12ab7022bea..f0dec6bd1120f1ca81b30e039c82f0449604b016 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.42 2000/10/12 07:38:13 ishii Exp $
+# $Header: /cvsroot/pgsql/src/interfaces/libpq/Makefile,v 1.43 2000/10/17 17:43:13 petere Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -17,7 +17,7 @@ NAME= pq
 SO_MAJOR_VERSION= 2
 SO_MINOR_VERSION= 1
 
-CFLAGS+= -DFRONTEND -I$(srcdir)
+override CFLAGS += -DFRONTEND -I$(srcdir) -DSYSCONFDIR='"$(sysconfdir)"'
 
 OBJS= fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o \
       pqexpbuffer.o dllist.o pqsignal.o $(SNPRINTF) $(INET_ATON)
index bf07929f50a0635864c69d072a8ddd6f0d6dc418..e6ecfe153e3af678593ef6f18f5e180f14701346 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.139 2000/10/17 01:00:58 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.140 2000/10/17 17:43:13 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -2095,9 +2095,15 @@ pqPacketSend(PGconn *conn, const char *buf, size_t len)
        return STATUS_OK;
 }
 
+
+
+#ifndef SYSCONFDIR
+# error "You must compile this file with SYSCONFDIR defined."
+#endif
+
 int parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage) {
   char *service = conninfo_getval(options, "service");
-  char *serviceFile = "/etc/pg_service.conf";
+  char *serviceFile = SYSCONFDIR "/pg_service.conf";
   int  MAXBUFSIZE = 256;
   int  group_found = 0;
   int  linenr=0, i;