From 6232d13f5321b87ddf12a1aa36b4545da45f173d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 17 Nov 2021 22:34:57 +0100 Subject: Travel3: Simple image and video display site Reads the images and videos from filesystem and builds a site in memroy. --- src/unique_fd.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/unique_fd.cc (limited to 'src/unique_fd.cc') diff --git a/src/unique_fd.cc b/src/unique_fd.cc new file mode 100644 index 0000000..eb2ed29 --- /dev/null +++ b/src/unique_fd.cc @@ -0,0 +1,10 @@ +#include "common.hh" + +#include "io.hh" +#include "unique_fd.hh" + +void unique_fd::reset(int fd) { + if (fd_ >= 0) + io::close(fd_); + fd_ = fd; +} -- cgit v1.2.3-70-g09d2