|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.402 2010/07/18 17:08:11 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.403 2010/07/19 18:53:25 petere Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
|
21 | 21 | #include<ctype.h>
|
22 | 22 | #include<time.h>
|
23 | 23 | #include<unistd.h>
|
| 24 | +#ifdefHAVE_UCRED_H |
| 25 | +#include<ucred.h> |
| 26 | +#endif |
24 | 27 |
|
25 | 28 | #include"libpq-fe.h"
|
26 | 29 | #include"libpq-int.h"
|
@@ -1789,7 +1792,7 @@ PQconnectPoll(PGconn *conn)
|
1789 | 1792 | ucred_t*ucred;
|
1790 | 1793 |
|
1791 | 1794 | ucred=NULL;/* must be initialized to NULL */
|
1792 |
| -if (getpeerucred(sock,&ucred)==-1) |
| 1795 | +if (getpeerucred(conn->sock,&ucred)==-1) |
1793 | 1796 | {
|
1794 | 1797 | appendPQExpBuffer(&conn->errorMessage,
|
1795 | 1798 | libpq_gettext("could not get peer credentials: %s\n"),
|
|