]> arthur.barton.de Git - netatalk.git/commitdiff
Fixes
authorFrank Lahm <franklahm@googlemail.com>
Tue, 25 Jan 2011 13:00:34 +0000 (14:00 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 25 Jan 2011 13:00:34 +0000 (14:00 +0100)
etc/afpd/file.c
etc/afpd/filedir.c
include/atalk/adouble.h
include/atalk/locking.h
libatalk/adouble/ad_flush.c
libatalk/rpc/locking.c

index e827134ab1750e14af420a1a2ccb27c872e96008..706577067b5a98ab839202ec712c587b177f7f5f 100644 (file)
@@ -1121,8 +1121,7 @@ int renamefile(const struct vol *vol, int sdir_fd, char *src, char *dst, char *n
         }
     }
 
-    /* don't care if we can't open the newly renamed ressource fork
-     */
+    /* don't care if we can't open the newly renamed ressource fork */
     if (ad_open(adp, dst, ADFLAGS_HF, O_RDWR) == 0) {
         ad_setname(adp, newname);
         ad_flush( adp );
index 9ec0271aab269530e2d567585ce8c09ebdb24e51..47b819f95255f09625054b9f0157944144f23649 100644 (file)
@@ -380,6 +380,7 @@ static int moveandrename(const struct vol *vol,
         u_int16_t bshort;
 
         ad_getattr(adp, &bshort);
+        
         ad_close_metadata( adp);
         if ((bshort & htons(ATTRBIT_NORENAME))) {
             rc = AFPERR_OLOCK;
index 60032780c321caa9aebba006352ff11037163818..eac8be144cc7ecfec168d5b809b3a67edddb9f9a 100644 (file)
@@ -43,6 +43,7 @@
 
 #include <netatalk/endian.h>
 #include <atalk/bstrlib.h>
+#include <atalk/locking.h>
 
 /* version info */
 #define AD_VERSION2     0x00020000
index 5f88d88ecfc10f9f9234efbcd2cceabdc761985c..e1c1303aaeb6d0459118c3719357b46460307cc8 100644 (file)
 #include <sys/types.h>
 #include <inttypes.h>
 
-#include <atalk/adouble.h>
 #include <atalk/lockrpc.gen.h>
 
 #include "event2/event.h"
 #include "event2/http.h"
 #include "event2/rpc.h"
 
+struct adouble;
+
 extern int rpc_init(const char *addr, unsigned short port);
 extern int rpc_lock(struct adouble *, uint32_t eid, int type, off_t off, off_t len, int user);
 extern void rpc_unlock(struct adouble *, int user);
index 9c9c3891d522aaeca8259902f24a440c305d8e7b..3af59d909c81448bc664f5a777162965eabd0507 100644 (file)
@@ -184,16 +184,13 @@ int ad_flush(struct adouble *ad)
  * Close a struct adouble freeing all resources
  *
  * This close the whole thing, regardless of what you pass in adflags!
+ * When open forks are using this struct adouble (ad_refcount>0) the close
+ * request is ignored.
  */
 int ad_close( struct adouble *ad, int adflags)
 {
     int err = 0;
 
-    if (ad->ad_inited == AD_CLOSED) {
-        LOG(log_warning, logtype_default, "ad_close: double close");
-        return 0;
-    }
-
     LOG(log_debug, logtype_default, "ad_close(\"%s\", %s)",
         cfrombstr(ad->ad_fullpath),
         adflags2logstr(adflags));
@@ -236,7 +233,5 @@ int ad_close( struct adouble *ad, int adflags)
         ad->ad_fullpath = NULL;
     }
 
-    ad->ad_inited = AD_CLOSED;
-
     return err;
 }
index 0aedaf532093bc38c80ebb83cb44361496cb8195..6916e07d6b2b80e126d8e8eef00b74e1f9497a36 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "event2/event.h"
 #include "event2/http.h"
+#include "event2/event_compat.h"
+#include "event2/http_compat.h"
 #include "event2/rpc.h"
 #include "event2/rpc_struct.h"
 
@@ -62,7 +64,8 @@ static void rpc_dummy(const char *name)
 
     EVRPC_MAKE_REQUEST(lock_msg, rpc_pool, lock_req, lock_rep, msg_rep_cb, NULL);
 
-    event_base_dispatch(ev_base);
+//    event_base_dispatch(ev_base);
+    event_dispatch();
 }
 
 int rpc_lock(struct adouble *ad, uint32_t eid, int type, off_t off, off_t len, int user)
@@ -89,13 +92,14 @@ int rpc_tmplock(struct adouble *ad, uint32_t eid, int type, off_t off, off_t len
 int rpc_init(const char *addr, unsigned short port)
 {
     EC_INIT;
-       struct evhttp_connection *evcon;
+    struct evhttp_connection *evcon;
 
-    EC_NULL_LOG(ev_base = event_base_new());
+//    EC_NULL_LOG(ev_base = event_base_new());
     event_set_log_callback(ev_log_cb);
-       EC_NULL_LOG(rpc_pool = evrpc_pool_new(ev_base));
-       EC_NULL_LOG(evcon = evhttp_connection_base_new(NULL, NULL, addr, port));
-
+//     EC_NULL_LOG(rpc_pool = evrpc_pool_new(ev_base));
+       EC_NULL_LOG(rpc_pool = evrpc_pool_new(NULL));
+//     EC_NULL_LOG(evcon = evhttp_connection_new(addr, port));
+       EC_NULL_LOG(evcon = evhttp_connection_new(addr, port));
        evrpc_pool_add_connection(rpc_pool, evcon);
 
 EC_CLEANUP: