NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / tests / test-poll.c
index 7ba0280..0cdb1f9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of poll() function.
-   Copyright (C) 2008-2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2014 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -96,6 +96,9 @@ open_server_socket ()
 
   s = socket (AF_INET, SOCK_STREAM, 0);
 
+  x = 1;
+  setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x));
+
   memset (&ia, 0, sizeof (ia));
   ia.sin_family = AF_INET;
   inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr);
@@ -106,9 +109,6 @@ open_server_socket ()
       exit (77);
     }
 
-  x = 1;
-  setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x));
-
   if (listen (s, 1) < 0)
     {
       perror ("listen");