Deleted Added
full compact
res_init.c (156956) res_init.c (160965)
1/*
2 * Copyright (c) 1985, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
69 */
70
71#if defined(LIBC_SCCS) && !defined(lint)
72static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
73static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.5 2005/11/03 00:00:52 marka Exp $";
74#endif /* LIBC_SCCS and not lint */
75#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1985, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
69 */
70
71#if defined(LIBC_SCCS) && !defined(lint)
72static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
73static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.5 2005/11/03 00:00:52 marka Exp $";
74#endif /* LIBC_SCCS and not lint */
75#include <sys/cdefs.h>
76__FBSDID("$FreeBSD: head/lib/libc/resolv/res_init.c 156956 2006-03-21 15:37:16Z ume $");
76__FBSDID("$FreeBSD: head/lib/libc/resolv/res_init.c 160965 2006-08-04 10:21:11Z ume $");
77
78#include "port_before.h"
79
77
78#include "port_before.h"
79
80#include "namespace.h"
81
80#include <sys/types.h>
81#include <sys/param.h>
82#include <sys/socket.h>
83#include <sys/time.h>
84
85#include <netinet/in.h>
86#include <arpa/inet.h>
87#include <arpa/nameser.h>
88
89#include <ctype.h>
90#include <stdio.h>
91#include <stdlib.h>
92#include <string.h>
93#include <unistd.h>
94#include <netdb.h>
95
82#include <sys/types.h>
83#include <sys/param.h>
84#include <sys/socket.h>
85#include <sys/time.h>
86
87#include <netinet/in.h>
88#include <arpa/inet.h>
89#include <arpa/nameser.h>
90
91#include <ctype.h>
92#include <stdio.h>
93#include <stdlib.h>
94#include <string.h>
95#include <unistd.h>
96#include <netdb.h>
97
98#include "un-namespace.h"
99
96#include "port_after.h"
97
98/* ensure that sockaddr_in6 and IN6ADDR_ANY_INIT are declared / defined */
99#include <resolv.h>
100
101#include "res_private.h"
102
103/* Options. Should all be left alone. */

--- 626 unchanged lines hidden (view full) ---

730 *
731 * This routine is not expected to be user visible.
732 */
733void
734res_nclose(res_state statp) {
735 int ns;
736
737 if (statp->_vcsock >= 0) {
100#include "port_after.h"
101
102/* ensure that sockaddr_in6 and IN6ADDR_ANY_INIT are declared / defined */
103#include <resolv.h>
104
105#include "res_private.h"
106
107/* Options. Should all be left alone. */

--- 626 unchanged lines hidden (view full) ---

734 *
735 * This routine is not expected to be user visible.
736 */
737void
738res_nclose(res_state statp) {
739 int ns;
740
741 if (statp->_vcsock >= 0) {
738 (void) close(statp->_vcsock);
742 (void) _close(statp->_vcsock);
739 statp->_vcsock = -1;
740 statp->_flags &= ~(RES_F_VC | RES_F_CONN);
741 }
742 for (ns = 0; ns < statp->_u._ext.nscount; ns++) {
743 if (statp->_u._ext.nssocks[ns] != -1) {
743 statp->_vcsock = -1;
744 statp->_flags &= ~(RES_F_VC | RES_F_CONN);
745 }
746 for (ns = 0; ns < statp->_u._ext.nscount; ns++) {
747 if (statp->_u._ext.nssocks[ns] != -1) {
744 (void) close(statp->_u._ext.nssocks[ns]);
748 (void) _close(statp->_u._ext.nssocks[ns]);
745 statp->_u._ext.nssocks[ns] = -1;
746 }
747 }
748}
749
750void
751res_ndestroy(res_state statp) {
752 res_nclose(statp);

--- 118 unchanged lines hidden ---
749 statp->_u._ext.nssocks[ns] = -1;
750 }
751 }
752}
753
754void
755res_ndestroy(res_state statp) {
756 res_nclose(statp);

--- 118 unchanged lines hidden ---