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:
parent
2bc5861dc0
commit
349c9389dd
1 changed files with 2 additions and 2 deletions
4
haggis.c
4
haggis.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue