Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/librumpclient More of previous.



details:   https://anonhg.NetBSD.org/src/rev/cba4b5f4c1e5
branches:  trunk
changeset: 349038:cba4b5f4c1e5
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Nov 21 06:19:26 2016 +0000

description:
More of previous.

diffstat:

 tests/lib/librumpclient/h_execthr.c |  19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diffs (40 lines):

diff -r dd90c64e1279 -r cba4b5f4c1e5 tests/lib/librumpclient/h_execthr.c
--- a/tests/lib/librumpclient/h_execthr.c       Mon Nov 21 06:17:20 2016 +0000
+++ b/tests/lib/librumpclient/h_execthr.c       Mon Nov 21 06:19:26 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: h_execthr.c,v 1.4 2016/11/21 06:17:20 dholland Exp $   */
+/*     $NetBSD: h_execthr.c,v 1.5 2016/11/21 06:19:26 dholland Exp $   */
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -114,9 +114,10 @@
 
        if (execd) {
                canreturn = 1;
-               if (pthread_create(&pt, NULL,
-                   wrk, (void *)(uintptr_t)P2_0) != 0)
-                       errx(1, "exec pthread_create");
+               errno = pthread_create(&pt, NULL,
+                   wrk, (void *)(uintptr_t)P2_0);
+               if (errno != 0)
+                       err(1, "exec pthread_create");
 
                i = 37;
                rump_sys_write(P2_1, &i, sizeof(i));
@@ -177,10 +178,12 @@
         * load up one more (big) set.  these won't start executing, though,
         * but we're interested in if they create blockage
         */
-       for (i = 0; i < 3*NTHR; i++)
-               if (pthread_create(&pt, NULL,
-                   wrk, (void *)(uintptr_t)p1[0]) != 0)
-                       errx(1, "pthread_create 1 %d", i);
+       for (i = 0; i < 3*NTHR; i++) {
+               errno = pthread_create(&pt, NULL,
+                   wrk, (void *)(uintptr_t)p1[0]);
+               if (errno != 0)
+                       err(1, "pthread_create 3 %d", i);
+       }
 
        /* then, we exec! */
        execarg[0] = argv[0];



Home | Main Index | Thread Index | Old Index