Deleted Added
full compact
listenclose.c (256281) listenclose.c (281974)
1/*-
2 * Copyright (c) 2004-2005 Robert N. M. Watson
3 * 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2004-2005 Robert N. M. Watson
3 * 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: stable/10/tools/regression/sockets/listenclose/listenclose.c 146250 2005-05-16 00:53:38Z rwatson $
26 * $FreeBSD: stable/10/tools/regression/sockets/listenclose/listenclose.c 281974 2015-04-25 05:31:52Z ngie $
27 */
28
29#include <sys/types.h>
30#include <sys/socket.h>
31
32#include <netinet/in.h>
33
34#include <arpa/inet.h>

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

47 * being aborted, which is a not-often-followed code path. To do this, we
48 * create a local TCP socket, build a non-blocking connection to it, and then
49 * close the accept socket. The connection must be non-blocking or the
50 * program will block and as such connect() will not return as accept() is
51 * never called.
52 */
53
54int
27 */
28
29#include <sys/types.h>
30#include <sys/socket.h>
31
32#include <netinet/in.h>
33
34#include <arpa/inet.h>

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

47 * being aborted, which is a not-often-followed code path. To do this, we
48 * create a local TCP socket, build a non-blocking connection to it, and then
49 * close the accept socket. The connection must be non-blocking or the
50 * program will block and as such connect() will not return as accept() is
51 * never called.
52 */
53
54int
55main(int argc, char *argv[])
55main(void)
56{
57 int listen_sock, connect_sock;
58 struct sockaddr_in sin;
59 socklen_t len;
60 u_short port;
61 int arg;
62
63 listen_sock = socket(PF_INET, SOCK_STREAM, 0);

--- 48 unchanged lines hidden ---
56{
57 int listen_sock, connect_sock;
58 struct sockaddr_in sin;
59 socklen_t len;
60 u_short port;
61 int arg;
62
63 listen_sock = socket(PF_INET, SOCK_STREAM, 0);

--- 48 unchanged lines hidden ---