mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Clean up code in libpq that obtains user's home directory: make a single
subroutine that can hide platform dependencies. The WIN32 path is still a stub, but I await a fix from one of the win32 hackers. Also clean up unnecessary #ifdef WIN32 ugliness in a couple of places.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.294 2004/12/31 22:03:50 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.295 2005/01/04 23:18:25 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1944,7 +1944,7 @@ makeEmptyPGconn(void)
|
||||
PGconn *conn;
|
||||
|
||||
#ifdef WIN32
|
||||
/* needed to use the static libpq under windows as well */
|
||||
/* make sure socket support is up and running */
|
||||
WSADATA wsaData;
|
||||
|
||||
if (WSAStartup(MAKEWORD(1, 1), &wsaData))
|
||||
@ -2324,12 +2324,7 @@ retry5:
|
||||
|
||||
/* All done */
|
||||
closesocket(tmpsock);
|
||||
#ifdef WIN32
|
||||
WSASetLastError(save_errno);
|
||||
#else
|
||||
errno = save_errno;
|
||||
#endif
|
||||
|
||||
SOCK_ERRNO_SET(save_errno);
|
||||
return TRUE;
|
||||
|
||||
cancel_errReturn:
|
||||
@ -2346,12 +2341,7 @@ cancel_errReturn:
|
||||
}
|
||||
if (tmpsock >= 0)
|
||||
closesocket(tmpsock);
|
||||
#ifdef WIN32
|
||||
WSASetLastError(save_errno);
|
||||
#else
|
||||
errno = save_errno;
|
||||
#endif
|
||||
|
||||
SOCK_ERRNO_SET(save_errno);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user