]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/fce_api.c
quotas: improve Linux quota behaviour
[netatalk.git] / etc / afpd / fce_api.c
index 5f6b70ba077ea9dde9e71bcc43ed2a3a3c33208b..4620378922d763010ac006a700670f5fd194fdc1 100644 (file)
@@ -68,7 +68,7 @@ static unsigned long fce_ev_enabled =
     (1 << FCE_DIR_CREATE);
 
 #define MAXIOBUF 1024
-static char iobuf[MAXIOBUF];
+static unsigned char iobuf[MAXIOBUF];
 static const char *skip_files[] = 
 {
        ".DS_Store",
@@ -165,7 +165,6 @@ static ssize_t build_fce_packet( struct fce_packet *packet, const char *path, in
 {
     size_t pathlen = 0;
     ssize_t data_len = 0;
-    uint64_t *t;
 
     /* Set content of packet */
     memcpy(packet->magic, FCE_PACKET_MAGIC, sizeof(packet->magic) );
@@ -229,7 +228,6 @@ static void send_fce_event(const char *path, int event)
     static bool first_event = true;
 
     struct fce_packet packet;
-    void *data = &packet;
     static uint32_t event_id = 0; /* the unique packet couter to detect packet/data loss. Going from 0xFFFFFFFF to 0x0 is a valid increment */
     time_t now = time(NULL);
 
@@ -363,9 +361,10 @@ int fce_register(fce_ev_t event, const char *path, const char *oldpath, fce_obj_
         return AFP_OK;
 
     AFP_ASSERT(event >= FCE_FIRST_EVENT && event <= FCE_LAST_EVENT);
+    AFP_ASSERT(path);
 
     LOG(log_debug, logtype_fce, "register_fce(path: %s, type: %s, event: %s",
-        path , type == fce_dir ? "dir" : "file", fce_event_names[event]);
+        path, type == fce_dir ? "dir" : "file", fce_event_names[event]);
 
     bname = basename_safe(path);
 
@@ -373,8 +372,6 @@ int fce_register(fce_ev_t event, const char *path, const char *oldpath, fce_obj_
         /* No listeners configured */
         return AFP_OK;
 
-    if (path == NULL)
-        return AFPERR_PARAM;
 
        /* do some initialization on the fly the first time */
        if (first_event) {
@@ -427,6 +424,8 @@ static void check_saved_close_events(int fmodwait)
  * */
 void fce_pending_events(AFPObj *obj)
 {
+    if (!udp_sockets)
+        return;
     check_saved_close_events(obj->options.fce_fmodwait);
 }
 
@@ -490,7 +489,7 @@ void shortsleep( unsigned int us )
 }
 int main( int argc, char*argv[] )
 {
-    int c,ret;
+    int c;
 
     char *port = FCE_DEFAULT_PORT_STRING;
     char *host = "localhost";