about summary refs log tree commit diff
path: root/nptl/tst-cancel4.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-08-07 01:13:17 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-08-07 01:13:17 +0200
commitb71bc845dd81e7d29958661a086fd6c643a7d268 (patch)
treed593ce8e06d80d0eed341aafebf845d88c5a1329 /nptl/tst-cancel4.c
parent4ebd73d43f73702301640baecca35458a327996d (diff)
downloadglibc-b71bc845dd81e7d29958661a086fd6c643a7d268.tar.gz
glibc-b71bc845dd81e7d29958661a086fd6c643a7d268.tar.xz
glibc-b71bc845dd81e7d29958661a086fd6c643a7d268.zip
tst-cancel4: Make blocking on write more portable
* nptl/tst-cancel4.c (tf_send, tf_sendto): Set socket buffer size after
connecting.
Diffstat (limited to 'nptl/tst-cancel4.c')
-rw-r--r--nptl/tst-cancel4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index 5250a30b2e..6a4fb64894 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -753,13 +753,13 @@ tf_send (void *arg)
   if (tempfd2 == -1)
     FAIL_EXIT1 ("socket (AF_UNIX, SOCK_STREAM, 0): %m");
 
-  set_socket_buffer (tempfd2);
-
   if (connect (tempfd2, (struct sockaddr *) &sun, sizeof (sun)) != 0)
     FAIL_EXIT1 ("connect: %m");
 
   unlink (sun.sun_path);
 
+  set_socket_buffer (tempfd2);
+
   xpthread_barrier_wait (&b2);
 
   if (arg != NULL)
@@ -1288,13 +1288,13 @@ tf_sendto (void *arg)
   if (tempfd2 == -1)
     FAIL_EXIT1 ("socket (AF_UNIX, SOCK_STREAM, 0): %m");
 
-  set_socket_buffer (tempfd2);
-
   if (connect (tempfd2, (struct sockaddr *) &sun, sizeof (sun)) != 0)
     FAIL_EXIT1 ("connect: %m");
 
   unlink (sun.sun_path);
 
+  set_socket_buffer (tempfd2);
+
   xpthread_barrier_wait (&b2);
 
   if (arg != NULL)