Skip to content
Snippets Groups Projects
Commit 8d699d9c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

posix: preserve errno on error

Do not use -1 as file descriptor, which overwrites errno with EBADF.
parent 4f6920b1
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@
void *picture_Allocate(int *restrict fdp, size_t size)
{
int fd = vlc_memfd();
if (fd == -1)
return NULL;
if (ftruncate(fd, size)) {
error:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment