data = (const uint8_t*) data + 9;
len -= 9;
- fd = mkostemp(path, O_WRONLY);
+ fd = mkostemp_safe(path, O_WRONLY|O_CLOEXEC);
if (fd < 0) {
log_error("Failed to create temporary file: %m");
return -errno;
goto finish;
}
- close_nointr_nofail(fd);
- fd = -1;
+ fd = safe_close(fd);
pid = fork();
if (pid < 0) {