]> arthur.barton.de Git - netatalk.git/blobdiff - etc/cnid_dbd/cnid_metad.c
Merge branch-2-1
[netatalk.git] / etc / cnid_dbd / cnid_metad.c
index 3ce9151c9a4f94eff9be641b2fe9264c08fec657..23a6fd0266334e05e9dbb7f9e396890780cade9a 100644 (file)
@@ -1,9 +1,8 @@
 /*
- * $Id: cnid_metad.c,v 1.22 2009-11-16 02:04:47 didg Exp $
- *
  * Copyright (C) Joerg Lenneis 2003
- * All Rights Reserved.  See COPYING.
+ * Copyright (C) Frank Lahm 2009, 2010
  *
+ * All Rights Reserved.  See COPYING.
  */
 
 /* 
@@ -22,6 +21,8 @@
    Result:
                        via TCP socket
    4.       afpd          ------->         cnid_dbd
+
+   cnid_metad and cnid_dbd have been converted to non-blocking IO in 2010.
  */
 
 
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
-#endif
-#ifdef HAVE_SYS_UIO_H
 #include <sys/uio.h>
-#endif
 #include <sys/un.h>
 #define _XPG4_2 1
 #include <sys/socket.h>
@@ -604,9 +597,8 @@ int main(int argc, char *argv[])
         if (rqstfd <= 0)
             continue;
 
-        /* TODO: Check out read errors, broken pipe etc. in libatalk. Is
-           SIGIPE ignored there? Answer: Ignored for dsi, but not for asp ... */
-        ret = readt(rqstfd, &len, sizeof(int), 1, 5);
+        ret = readt(rqstfd, &len, sizeof(int), 1, 4);
+
         if (!ret) {
             /* already close */
             goto loop_end;
@@ -628,7 +620,7 @@ int main(int argc, char *argv[])
             goto loop_end;
         }
 
-        actual_len = read(rqstfd, dbdir, len);
+        actual_len = readt(rqstfd, dbdir, len, 1);
         if (actual_len < 0) {
             LOG(log_severe, logtype_cnid, "Read(2) error : %s", strerror(errno));
             goto loop_end;