From 64ce1c0f51b4d0c07c124071ea2cd8002eccd45d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 26 Apr 2014 22:20:27 +0200 Subject: pthread_create returns an error instead of setting errno --- src/resolve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolve.c b/src/resolve.c index 7c512ee..52729cc 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -126,7 +126,7 @@ void fastd_resolve_peer(fastd_peer_t *peer, fastd_remote_t *remote) { arg->constraints = remote->config->address; pthread_t thread; - if (pthread_create(&thread, NULL, resolve_peer, arg) != 0) { + if ((errno = pthread_create(&thread, NULL, resolve_peer, arg)) != 0) { pr_error_errno("unable to create resolver thread"); free(arg->hostname); -- cgit v1.2.3