diff options
author | Karel Zak | 2017-05-30 10:26:17 +0200 |
---|---|---|
committer | Karel Zak | 2017-05-30 10:26:17 +0200 |
commit | b770b487004778f4425639c7ed1bb6ca22d157bf (patch) | |
tree | ecba0e786c2ffda1b5b9610633ff461e3f46e1f9 /misc-utils/test_uuidd.c | |
parent | wall: make sure with not referencing a null pointer (diff) | |
download | kernel-qcow2-util-linux-b770b487004778f4425639c7ed1bb6ca22d157bf.tar.gz kernel-qcow2-util-linux-b770b487004778f4425639c7ed1bb6ca22d157bf.tar.xz kernel-qcow2-util-linux-b770b487004778f4425639c7ed1bb6ca22d157bf.zip |
test_uuidd: don't use error.h
The header file is not provided by musl-libc.
Reported-by: Assaf Gordon <assafgordon@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/test_uuidd.c')
-rw-r--r-- | misc-utils/test_uuidd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/misc-utils/test_uuidd.c b/misc-utils/test_uuidd.c index 66a9f2d3b..73cc90a17 100644 --- a/misc-utils/test_uuidd.c +++ b/misc-utils/test_uuidd.c @@ -23,7 +23,6 @@ * * make uuidd uuidgen localstatedir=/var */ -#include <error.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h> @@ -169,7 +168,8 @@ static void create_nthreads(process_t *proc, size_t index) rc = pthread_attr_init(&th->thread_attr); if (rc) { - error(0, rc, "%d: pthread_attr_init failed", proc->pid); + errno = rc; + warn("%d: pthread_attr_init failed", proc->pid); break; } @@ -178,7 +178,8 @@ static void create_nthreads(process_t *proc, size_t index) rc = pthread_create(&th->tid, &th->thread_attr, &thread_body, th); if (rc) { - error(0, rc, "%d: pthread_create failed", proc->pid); + errno = rc; + warn("%d: pthread_create failed", proc->pid); break; } @@ -197,8 +198,10 @@ static void create_nthreads(process_t *proc, size_t index) thread_t *th = &threads[i]; rc = pthread_join(th->tid, (void *) &th->retval); - if (rc) - error(EXIT_FAILURE, rc, "pthread_join failed"); + if (rc) { + errno = rc; + err(EXIT_FAILURE, "pthread_join failed"); + } LOG(2, (stderr, "%d: thread exited [tid=%d,return=%d]\n", proc->pid, (int) th->tid, th->retval)); |