fix missing synchronization in calls from dynamic linker to global ctors
[musl] / src / aio / lio_listio.c
index 532b17c..07145dd 100644 (file)
@@ -13,7 +13,7 @@ struct lio_state {
 
 static int lio_wait(struct lio_state *st)
 {
-       int i, err, got_err;
+       int i, err, got_err = 0;
        int cnt = st->cnt;
        struct aiocb **cbs = st->cbs;
 
@@ -109,7 +109,7 @@ int lio_listio(int mode, struct aiocb *restrict const *restrict cbs, int cnt, st
        if (mode == LIO_WAIT) {
                ret = lio_wait(st);
                free(st);
-               return 0;
+               return ret;
        }
 
        if (st) {