? Makefile.custom ? GNUmakefile ? Makefile.global ? log ? crtags ? backend/postgres ? backend/catalog/global.description ? backend/catalog/global.bki ? backend/catalog/template1.bki ? backend/catalog/template1.description ? backend/port/Makefile ? bin/initdb/initdb ? bin/initlocation/initlocation ? bin/ipcclean/ipcclean ? bin/pg_config/pg_config ? bin/pg_ctl/pg_ctl ? bin/pg_dump/pg_dump ? bin/pg_dump/pg_restore ? bin/pg_dump/pg_dumpall ? bin/pg_id/pg_id ? bin/pg_passwd/pg_passwd ? bin/pgaccess/pgaccess ? bin/pgtclsh/Makefile.tkdefs ? bin/pgtclsh/Makefile.tcldefs ? bin/pgtclsh/pgtclsh ? bin/pgtclsh/pgtksh ? bin/psql/psql ? bin/scripts/createlang ? include/config.h ? include/stamp-h ? interfaces/ecpg/lib/libecpg.so.3.2.0 ? interfaces/ecpg/preproc/ecpg ? interfaces/libpgeasy/libpgeasy.so.2.1 ? interfaces/libpgtcl/libpgtcl.so.2.1 ? interfaces/libpq/libpq.so.2.1 ? interfaces/perl5/blib ? interfaces/perl5/Makefile ? interfaces/perl5/pm_to_blib ? interfaces/perl5/Pg.c ? interfaces/perl5/Pg.bs ? pl/plperl/blib ? pl/plperl/Makefile ? pl/plperl/pm_to_blib ? pl/plperl/SPI.c ? pl/plperl/plperl.bs ? pl/plpgsql/src/libplpgsql.so.1.0 ? pl/tcl/Makefile.tcldefs Index: include/libpq/pqcomm.h =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/include/libpq/pqcomm.h,v retrieving revision 1.45 diff -c -r1.45 pqcomm.h *** include/libpq/pqcomm.h 2000/11/15 18:36:06 1.45 --- include/libpq/pqcomm.h 2000/11/22 01:33:54 *************** *** 51,66 **** /* Configure the UNIX socket address for the well known port. */ #if defined(SUN_LEN) - #define UNIXSOCK_PATH(sun,port,defpath) \ - ((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))) #define UNIXSOCK_LEN(sun) \ (SUN_LEN(&(sun))) #else - #define UNIXSOCK_PATH(sun,port,defpath) \ - ((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))) #define UNIXSOCK_LEN(sun) \ (strlen((sun).sun_path)+ offsetof(struct sockaddr_un, sun_path)) #endif /* * We do this because sun_len is in BSD's struct, while others don't. --- 51,65 ---- /* Configure the UNIX socket address for the well known port. */ #if defined(SUN_LEN) #define UNIXSOCK_LEN(sun) \ (SUN_LEN(&(sun))) #else #define UNIXSOCK_LEN(sun) \ (strlen((sun).sun_path)+ offsetof(struct sockaddr_un, sun_path)) #endif + + #define UNIXSOCK_PATH(sun,port,defpath) \ + (snprintf((sun).sun_path, UNIXSOCK_LEN(sun), "%s/.s.PGSQL.%d", (defpath && *(defpath) != '\0') ? (defpath) : "/tmp", (port))) /* * We do this because sun_len is in BSD's struct, while others don't.