]> sourceware.org Git - valgrind.git/commitdiff
vgdb: allow address reuse to avoid "address already in use" errors
authorAlexandra Petlanova Hajkova <ahajkova@redhat.com>
Wed, 7 Sep 2022 09:46:55 +0000 (05:46 -0400)
committerMark Wielaard <mark@klomp.org>
Sat, 12 Nov 2022 12:03:46 +0000 (13:03 +0100)
https://bugs.kde.org/show_bug.cgi?id=459476

NEWS
coregrind/vgdb.c

diff --git a/NEWS b/NEWS
index fe94546fbd66a83fd6116e76d7ff0449c0dc616b..a421b980c5def24ca16a828450763c7eabe6fbdc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 
 170510  Don't warn about ioctl of size 0 without direction hint
 444110  priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition.
+459476  vgdb: allow address reuse to avoid "address already in use" errorsuse" errors
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 3f438536b2032f5276df6e85970b4df7f1cefb0b..83f49c840dae0e5411bae658366a94901226139f 100644 (file)
@@ -498,6 +498,14 @@ void wait_for_gdb_connect(int in_port)
       XERROR(errno, "cannot create socket\n");
    }
 
+   /* allow address reuse to avoid "address already in use" errors */
+
+   int one = 1;
+   if (setsockopt(listen_gdb, SOL_SOCKET, SO_REUSEADDR,
+                  &one, sizeof(one)) < 0) {
+      XERROR(errno, "cannot enable address reuse\n");
+   }
+
     memset(&addr, 0, sizeof(addr));
 
     addr.sin_family = AF_INET;
This page took 0.094514 seconds and 5 git commands to generate.