From: Philippe Waroquiers Date: Thu, 28 Aug 2014 20:19:41 +0000 (+0000) Subject: Check that vgdb ptrace actions do not cause a EINTR or whatever X-Git-Tag: svn/VALGRIND_3_10_0~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b9ae3e047e5a2ea3e204cf3b1803e8202e4167f;p=thirdparty%2Fvalgrind.git Check that vgdb ptrace actions do not cause a EINTR or whatever to go out of the select syscall git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14378 --- diff --git a/gdbserver_tests/sleepers.c b/gdbserver_tests/sleepers.c index b74d3cabb4..e06e0cd744 100644 --- a/gdbserver_tests/sleepers.c +++ b/gdbserver_tests/sleepers.c @@ -71,7 +71,7 @@ static void *sleeper_or_burner(void *v) { int i = 0; struct spec* s = (struct spec*)v; - + int ret; fprintf(stderr, "%s ready to sleep and/or burn\n", s->name); fflush (stderr); signal_ready(); @@ -81,7 +81,10 @@ static void *sleeper_or_burner(void *v) if (sleepms > 0 && s->sleep) { t[s->t].tv_sec = sleepms / 1000; t[s->t].tv_usec = (sleepms % 1000) * 1000; - select (0, NULL, NULL, NULL, &t[s->t]); + ret = select (0, NULL, NULL, NULL, &t[s->t]); + /* We only expect a timeout result from the above. */ + if (ret != 0) + perror("unexpected result from select"); } if (burn > 0 && s->burn) do_burn();