X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=util.h;fp=util.h;h=d1670750d522f36ec7032736530516b10d59b894;hp=303de14d0098e26cbd8f9c535cd6e2438f92021e;hb=3fd8650ccf3da3960a946d8ac9abc305aec399ce;hpb=8d2593119a04e6b30d5c36a722a77ee32f1d454b diff --git a/util.h b/util.h index 303de14..d167075 100644 --- a/util.h +++ b/util.h @@ -15,4 +15,8 @@ bool read_tempfile_and_close(int fd, std::string *contents); // Same as read_tempfile_and_close(), without the close. bool read_tempfile(int fd, std::string *contents); +// Close a file descriptor, taking care of EINTR on the way. +// log_perror() if it fails; apart from that, behaves as close(). +int safe_close(int fd); + #endif // !defined(_UTIL_H