/*
- * $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.
*/
/*
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>
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;
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;