diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-20 01:25:25 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-20 01:25:25 +0000 |
commit | 597da3199199b14e2722a1ada9fccb3737814d7f (patch) | |
tree | b475f359033bb4063109bd5404e3d5a943578b0d /regress/lib/libpthread | |
parent | f45d4774a3a08f1a090fecf301051d4c28ec94f6 (diff) |
Use errc/warnc to simplify code.
Also, in 'ftp', always put the error message last, after the hostname/ipaddr.
ok jsing@ krw@ millert@
Diffstat (limited to 'regress/lib/libpthread')
-rw-r--r-- | regress/lib/libpthread/earlysig/earlysig.c | 4 | ||||
-rw-r--r-- | regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/regress/lib/libpthread/earlysig/earlysig.c b/regress/lib/libpthread/earlysig/earlysig.c index e65caaad53f..0ab4f7f04cc 100644 --- a/regress/lib/libpthread/earlysig/earlysig.c +++ b/regress/lib/libpthread/earlysig/earlysig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: earlysig.c,v 1.1 2013/06/21 06:47:20 guenther Exp $ */ +/* $OpenBSD: earlysig.c,v 1.2 2014/05/20 01:25:24 guenther Exp $ */ /* * Public domain. 2005, Otto Moerbeek; 2013, Philip Guenther @@ -43,7 +43,7 @@ main() /* make sure the thread library is fully active */ if ((r = pthread_create(&tid, NULL, tmain, NULL))) - errx(1, "pthread_create: %s", strerror(r)); + errc(1, r, "pthread_create"); pthread_join(tid, NULL); /* make sure kill() and all the symbols in fork() are bound */ diff --git a/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c b/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c index 93f399e5476..6e0c4674aba 100644 --- a/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c +++ b/regress/lib/libpthread/pthread_rwlock/pthread_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread_rwlock.c,v 1.2 2012/02/26 11:47:51 miod Exp $ */ +/* $OpenBSD: pthread_rwlock.c,v 1.3 2014/05/20 01:25:24 guenther Exp $ */ /* PUBLIC DOMAIN Feb 2012 <guenther@openbsd.org> */ #include <sys/types.h> @@ -132,11 +132,11 @@ main(void) for (i = 0; i < NUM_READERS; i++) { ids[i] = i; if ((r = pthread_create(&tr[i], NULL, reader, &ids[i]))) - errx(1, "create %d: %s", i, strerror(r)); + errc(1, r, "create %d", i); } if ((r = pthread_create(&tw, NULL, writer, NULL))) - errx(1, "create writer: %s", strerror(r)); + errc(1, r, "create writer"); pthread_mutex_lock(&m); while (state != WRITE) |