From: Andre Noll Date: Mon, 14 Aug 2017 00:10:44 +0000 (+0200) Subject: fd.c: Change return value of file_exists() to bool. X-Git-Tag: v0.6.1~5 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=3256f3c144a66a50423d025c13564035c22230f7;p=paraslash.git fd.c: Change return value of file_exists() to bool. file_exists() is in fact a misnomer, since it simply calls stat(2), which may fail for many reasons besides ENOENT. But that's another issue for another patch.. --- diff --git a/fd.c b/fd.c index f1c3792c..7079b51c 100644 --- a/fd.c +++ b/fd.c @@ -316,9 +316,9 @@ out: * * \param fn The file name. * - * \return Non-zero iff file exists. + * \return True iff file exists. */ -int file_exists(const char *fn) +bool file_exists(const char *fn) { struct stat statbuf; diff --git a/fd.h b/fd.h index b8b81bbe..106f5a4c 100644 --- a/fd.h +++ b/fd.h @@ -5,7 +5,7 @@ int xrename(const char *oldpath, const char *newpath); int write_all(int fd, const char *buf, size_t len); __printf_2_3 int write_va_buffer(int fd, const char *fmt, ...); -int file_exists(const char *); +bool file_exists(const char *); int para_select(int n, fd_set *readfds, fd_set *writefds, struct timeval *timeout_tv); __must_check int mark_fd_nonblocking(int fd);