Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Tookmund/Swapspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Tookmund committed Aug 4, 2016
2 parents 385085c + fa480c7 commit 9abce25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ SUBDIRS = src
sysconf_DATA = swapspace.conf

install-data-local:
$(MKDIR_P) $(localstatedir)/lib/swapspace
$(MKDIR_P) $(DESTDIR)/$(localstatedir)/lib/swapspace
7 changes: 6 additions & 1 deletion src/swaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ static memsize_t filesize(const char name[])
if (unlikely(pos == -1))
log_perr_str(LOG_WARNING, "Can't determine size of", name, errno);

close(fd);

return pos;
}

Expand Down Expand Up @@ -703,7 +705,10 @@ static bool retire_swapfile(int file)
unlink(namebuf);

#ifndef NO_CONFIG
if (fd != -1) write_data(fd, swapfiles[file].size, true);
if (fd != -1) {
write_data(fd, swapfiles[file].size, true);
close(fd);
}
#endif

swapfiles[file].size = 0;
Expand Down

0 comments on commit 9abce25

Please sign in to comment.