Flush and close file descriptor after write when extracting a file node;

Remove #include directives automatically added by editor which only
exist on Linux;
This commit is contained in:
Nathan Fisher 2023-09-22 10:16:53 -04:00
parent 2bc5861dc0
commit 349c9389dd

View file

@ -32,12 +32,10 @@
#include "haggis.h"
#include "mq.h"
#include <asm-generic/errno-base.h>
#include <assert.h>
#include <errno.h>
#include <libgen.h>
#include <limits.h> // PATH_MAX
#include <linux/limits.h>
#include <stddef.h>
#include <stdint.h> // uint<x>_t
#include <sys/unistd.h>
@ -846,6 +844,8 @@ int haggis_extract_file(haggis_node *node, char *basedir) {
if (ret != len) {
return 2;
}
fflush(fd);
fclose(fd);
free(path);
return 0;
}