diff options
Diffstat (limited to 'nscd/nscd_getpw_r.c')
-rw-r--r-- | nscd/nscd_getpw_r.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/nscd/nscd_getpw_r.c b/nscd/nscd_getpw_r.c index 7e7ed619c8..abd059e539 100644 --- a/nscd/nscd_getpw_r.c +++ b/nscd/nscd_getpw_r.c @@ -60,39 +60,13 @@ __nscd_getpwuid_r (uid_t uid, struct passwd *resultbuf, char *buffer, return nscd_getpw_r (buf, n, GETPWBYUID, resultbuf, buffer, buflen); } -/* Create a socket connected to a name. */ -static int -open_socket (void) -{ - struct sockaddr_un addr; - int sock; - int saved_errno = errno; - - sock = __socket (PF_UNIX, SOCK_STREAM, 0); - if (sock < 0) - { - __set_errno (saved_errno); - return -1; - } - - addr.sun_family = AF_UNIX; - strcpy (addr.sun_path, _PATH_NSCDSOCKET); - if (__connect (sock, (struct sockaddr *) &addr, sizeof (addr)) < 0) - { - __close (sock); - __set_errno (saved_errno); - return -1; - } - - return sock; -} static int internal_function nscd_getpw_r (const char *key, size_t keylen, request_type type, struct passwd *resultbuf, char *buffer, size_t buflen) { - int sock = open_socket (); + int sock = __nscd_open_socket (); request_header req; pw_response_header pw_resp; ssize_t nbytes; |