+1998-09-28 23:55 Ulrich Drepper <drepper@cygnus.com>
+
+ * nis/ypclnt.c (__yp_bind): Pretty print. Optimize readv result
+ check a bit. Also close socket of domain client. Close socket
+ in IPPORT_RESERVED error case.
+
+1998-09-28 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Use
+ CMSG_ALIGN (fixes a bug) and correct test for availability of
+ another entry.
+ * sysdeps/unix/sysv/linux/mips/bits/socket.h: Sync with generic
+ Linux version.
+ (__cmsg_nxthdr): Use CMSG_ALIGN (fixes a bug) and correct test for
+ availability of another entry.
+ Patch by ak@muc.de.
+
+ * sysdeps/unix/sysv/linux/netinet/ip.h (IPOPT_NOOP): Fix typo.
+ Patch by ak@muc.de.
+
+1998-09-27 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * posix/annexc.c (xsystem): New function. Use it instead of
+ system.
+
+1998-09-28 Ulrich Drepper <drepper@cygnus.com>
+
+ * stdlib/longlong.h: Remove #endif for #if removed in last change.
+
1998-09-25 Ulrich Drepper <drepper@cygnus.com>
* time/strftime.c [emacs]: Define my_strftime to emacs_strftimeu.
int is_new = 0;
int try;
- if ((domain == NULL) || (domain[0] == '\0'))
+ if (domain == NULL || domain[0] == '\0')
return YPERR_BADARGS;
if (ypdb != NULL)
vec[1].iov_base = &ypbr;
vec[1].iov_len = sizeof (ypbr);
- if (readv (fd, vec, 2) == vec[0].iov_len + vec[1].iov_len)
+ if (readv (fd, vec, 2) == sizeof (port) + sizeof (ypbr))
{
- memset (&ysd->dom_server_addr, '\0',
- sizeof ysd->dom_server_addr);
ysd->dom_server_addr.sin_family = AF_INET;
memcpy (&ysd->dom_server_addr.sin_port,
ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port,
if (ysd->dom_vers == -1)
{
- if(ysd->dom_client)
+ if (ysd->dom_client)
{
clnt_destroy(ysd->dom_client);
+ close (ysd->dom_socket);
ysd->dom_client = NULL;
ysd->dom_socket = -1;
}
if (ntohs (clnt_saddr.sin_port) >= IPPORT_RESERVED)
{
clnt_destroy (client);
+ close (clnt_sock);
if (is_new)
free (ysd);
return YPERR_YPBIND;
ysd->dom_domain[YPMAXDOMAIN] = '\0';
}
- if (ysd->dom_client)
- {
- clnt_destroy (ysd->dom_client);
- close (ysd->dom_socket);
- }
ysd->dom_socket = RPC_ANYSOCK;
ysd->dom_client = clntudp_create (&ysd->dom_server_addr, YPPROG, YPVERS,
UDPTIMEOUT, &ysd->dom_socket);
#define UDIV_TIME (3+7*32) /* 7 instructions/iteration. 32 iterations. */
extern USItype __udiv_qrnnd __P ((USItype *, USItype, USItype, USItype));
#define UDIV_TIME 140
-#endif /* LONGLONG_STANDALONE */
#endif /* udiv_qrnnd */
#endif /* __sparc__ */
_EXTERN_INLINE struct cmsghdr *
__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
{
- unsigned char *__p;
-
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
return NULL;
- __p = (((unsigned char *) __cmsg)
- + ((__cmsg->cmsg_len + sizeof (long int) - 1) & ~sizeof (long int)));
- if (__p >= (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
return NULL;
- return (struct cmsghdr *) __p;
+ return __cmsg;
}
/* Socket level message types. This must match the definitions in
#endif
#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
#define CMSG_FIRSTHDR(mhdr) \
- ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+ & ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
#ifndef _EXTERN_INLINE
_EXTERN_INLINE struct cmsghdr *
__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
{
- unsigned char *__p;
-
if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
/* The kernel header does this so there may be a reason. */
return NULL;
- __p = (((unsigned char *) __cmsg)
- + ((__cmsg->cmsg_len + sizeof (long int) - 1) & ~sizeof (long int)));
- if (__p >= (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
/* No more entries. */
return NULL;
- return (struct cmsghdr *) __p;
+ return __cmsg;
}
#define IPOPT_EOL 0 /* end of option list */
#define IPOPT_END IPOPT_EOL
#define IPOPT_NOP 1 /* no operation */
-#define IPOPT_NOOP IP_NOP
+#define IPOPT_NOOP IPOPT_NOP
#define IPOPT_RR 7 /* record packet route */
#define IPOPT_TS 68 /* timestamp */