X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2F_PDCLIB_fdopen.c;h=7b539528f8a91b97c791b582aece80998962e94b;hb=6cb7e8dab67e8807aad79c3bdc8f96d78a5e5dbc;hp=85563270fa5029c7d4dbe73971c8bb273f375f30;hpb=5fd032eae66fba700cb9927840222b068c62361e;p=pdclib diff --git a/functions/stdio/_PDCLIB_fdopen.c b/functions/stdio/_PDCLIB_fdopen.c index 8556327..7b53952 100644 --- a/functions/stdio/_PDCLIB_fdopen.c +++ b/functions/stdio/_PDCLIB_fdopen.c @@ -39,6 +39,12 @@ struct _PDCLIB_file_t * _PDCLIB_fdopen( _PDCLIB_fd_t fd, /* no memory */ return NULL; } + + if(mtx_init(&rc->lock, mtx_recursive) != thrd_success) { + free(rc); + return NULL; + } + rc->status = mode; rc->handle = fd; /* Setting pointers into the memory block allocated above */