correct error handling of ftruncate

error_handling v0.1.2
Avril 4 years ago
parent 688ea4be1a
commit a834612e23
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -3,7 +3,7 @@
PROJECT=cow PROJECT=cow
AUTHOR=Avril (Flanchan) <flanchan@cumallover.me> AUTHOR=Avril (Flanchan) <flanchan@cumallover.me>
VERSION=0.1.1 VERSION=0.1.2
ifeq ($(PREFIX),) ifeq ($(PREFIX),)
PREFIX := /usr/local PREFIX := /usr/local

@ -67,7 +67,7 @@ static inline int shm_fd(size_t size)
int fd = memfd_create("cow_create:shm_fd", 0); int fd = memfd_create("cow_create:shm_fd", 0);
#endif #endif
if(fd<=0) die("cow_create:shm_fd:memfd_create"); if(fd<=0) die("cow_create:shm_fd:memfd_create");
ftruncate(fd, size); if(ftruncate(fd, size) != 0) die("cow_create:shm_fd:ftruncate");
return fd; return fd;
} }

Loading…
Cancel
Save