]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/fce_util.c
Fix typo
[netatalk.git] / etc / afpd / fce_util.c
index ad6026f79a9e5aabdeb6746380009250d5d3eb94..07b59d73621555cf917eebbc4028ac347860cc37 100644 (file)
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
-
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <time.h>
-
-
+#include <stdbool.h>
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 
-#include <netatalk/at.h>
-
 #include <atalk/adouble.h>
 #include <atalk/vfs.h>
 #include <atalk/logger.h>
@@ -96,7 +92,7 @@ void fce_initialize_history()
        }
 }
 
-int fce_handle_coalescation( char *path, int is_dir, int mode )
+bool fce_handle_coalescation( char *path, int is_dir, int mode )
 {
        /* These two are used to eval our next index in history */
        /* the history is unsorted, speed should not be a problem, length is 10 */
@@ -105,11 +101,11 @@ int fce_handle_coalescation( char *path, int is_dir, int mode )
        struct timeval tv;
 
        if (coalesce == 0)
-               return FALSE;
+               return false;
 
        /* After a file creation *ALWAYS* a file modification is produced */
        if ((mode == FCE_FILE_CREATE) && (coalesce & FCE_COALESCE_CREATE))
-        return TRUE;
+        return true;
 
        /* get timestamp */
        gettimeofday(&tv, 0);
@@ -140,7 +136,7 @@ int fce_handle_coalescation( char *path, int is_dir, int mode )
                if ((coalesce & FCE_COALESCE_CREATE) && (fh->mode == FCE_DIR_CREATE)) {
                        /* Parent dir ? */
                        if (!strncmp(fh->path, path, strlen(fh->path)))
-                               return TRUE;
+                               return true;
                }
 
                /* If we find a parent dir we should be DELETED we are done */
@@ -149,7 +145,7 @@ int fce_handle_coalescation( char *path, int is_dir, int mode )
             && (mode == FCE_FILE_DELETE || mode == FCE_DIR_DELETE)) {
                        /* Parent dir ? */
                        if (!strncmp(fh->path, path, strlen(fh->path)))
-                               return TRUE;
+                               return true;
                }
 
                /* Detect oldest entry for next new entry */
@@ -166,7 +162,7 @@ int fce_handle_coalescation( char *path, int is_dir, int mode )
        strncpy( fce_history_list[oldest_entry_idx].path, path, MAXPATHLEN);
 
        /* we have to handle this event */
-       return FALSE;
+       return false;
 }
 
 /*
@@ -174,7 +170,7 @@ int fce_handle_coalescation( char *path, int is_dir, int mode )
  * all|delete|create
  */
 
-int fce_set_coalesce(char *opt)
+int fce_set_coalesce(const char *opt)
 {
     char *e;
     char *p;
@@ -195,6 +191,8 @@ int fce_set_coalesce(char *opt)
     }
 
     free(e);
+
+    return AFP_OK;
 }