]> arthur.barton.de Git - netatalk.git/blobdiff - test/afpd/afpfunc_helpers.c
Pass name to afp_config_parse and use NULL for processname as test
[netatalk.git] / test / afpd / afpfunc_helpers.c
index b5b8165f0b33dfce0772848c57d931e92a1f8dcd..4387bdfca7e852f7cb45e4f943cd352501c69df5 100644 (file)
 #include <atalk/directory.h>
 #include <atalk/queue.h>
 #include <atalk/bstrlib.h>
+#include <atalk/globals.h>
 
 #include "file.h"
 #include "filedir.h"
 #include "directory.h"
 #include "dircache.h"
 #include "hash.h"
-#include "globals.h"
 #include "afp_config.h"
 #include "volume.h"
 
@@ -176,6 +176,7 @@ int enumerate(AFPObj *obj, uint16_t vid, cnid_t did)
     char buf[bufsize];
     char *p = buf;
     int len = 0;
+    int ret;
 
     ADD(p, len , 2);
 
@@ -189,7 +190,11 @@ int enumerate(AFPObj *obj, uint16_t vid, cnid_t did)
 
     len += push_path(&p, "");
 
-    return afp_enumerate_ext2(obj, buf, len, rbuf, &rbuflen);
+    ret = afp_enumerate_ext2(obj, buf, len, rbuf, &rbuflen);
+
+    if (ret != AFPERR_NOOBJ && ret != AFP_OK)
+        return -1;
+    return 0;
 }
 
 uint16_t openvol(AFPObj *obj, const char *name)