]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
gdbserver regtest: add return value to sleepers select error message
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 22 Sep 2025 12:59:17 +0000 (14:59 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 22 Sep 2025 12:59:17 +0000 (14:59 +0200)
This is failing on FreeBSD 15 (looks like an OS or libc regression).
Improve the error message to make the problem clearer. errno is 0
but select is returning 93 (from a set of 0 fds!).

gdbserver_tests/sleepers.c

index b433c19847afa3abecd1282c6f03ed54b87c9763..51d197a8e7466d717f4b1760beb613cc48a928b0 100644 (file)
@@ -84,8 +84,11 @@ static void *sleeper_or_burner(void *v)
          t[s->t].tv_usec = (sleepms % 1000) * 1000;
          ret = select (0, NULL, NULL, NULL, &t[s->t]);
          /* We only expect a timeout result or EINTR from the above. */
-         if (ret != 0 && errno != EINTR)
-            perror("unexpected result from select");
+         if (ret != 0 && errno != EINTR) {
+            char buf[64];
+            snprintf(buf, 64, "unexpected result (%d) from select", ret);
+            perror(buf);
+         }
       }
       if (burn > 0 && s->burn)
          do_burn();