]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
fd.c: Change return value of file_exists() to bool.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 14 Aug 2017 00:10:44 +0000 (02:10 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 22 Sep 2017 14:38:50 +0000 (16:38 +0200)
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..

fd.c
fd.h

diff --git a/fd.c b/fd.c
index f1c3792cf97bd74176db3e2c87326d96d4e3e179..7079b51cc95c683af1187f0b4af1412b07e40950 100644 (file)
--- 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 b8b81bbe7fb25a4fcc6663908894959ed321a31d..106f5a4ceaaae81209385a23a73092a22a0035c0 100644 (file)
--- 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);