dns response handling: don't treat too many addresses as an error
[musl] / src / aio / lio_listio.c
index bd37767..a672812 100644 (file)
@@ -3,7 +3,6 @@
 #include <unistd.h>
 #include <string.h>
 #include "pthread_impl.h"
-#include "libc.h"
 
 struct lio_state {
        struct sigevent *sev;
@@ -114,7 +113,7 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
 
        if (st) {
                pthread_attr_t a;
-               sigset_t set;
+               sigset_t set, set_old;
                pthread_t td;
 
                if (sev->sigev_notify == SIGEV_THREAD) {
@@ -129,16 +128,14 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
                }
                pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
                sigfillset(&set);
-               pthread_sigmask(SIG_BLOCK, &set, &set);
+               pthread_sigmask(SIG_BLOCK, &set, &set_old);
                if (pthread_create(&td, &a, wait_thread, st)) {
                        free(st);
                        errno = EAGAIN;
                        return -1;
                }
-               pthread_sigmask(SIG_SETMASK, &set, 0);
+               pthread_sigmask(SIG_SETMASK, &set_old, 0);
        }
 
        return 0;
 }
-
-LFS64(lio_listio);