/*
- * $Id: comm.c,v 1.5 2009-10-18 17:50:13 didg Exp $
+ * $Id: comm.c,v 1.6 2009-10-19 08:09:07 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
* things and clean up fd_table. The same happens for any read/write errors.
*/
-static int check_fd(time_t timeout, const sigset_t *sigmask)
+static int check_fd(time_t timeout, const sigset_t *sigmask, time_t *now)
{
int fd;
fd_set readfds;
return -1;
}
+ time(&t);
+ if (now)
+ *now = t;
+
if (!ret)
return 0;
- time(&t);
if (FD_ISSET(control_fd, &readfds)) {
int l = 0;
}
/* ------------ */
-int comm_rcv(struct cnid_dbd_rqst *rqst, time_t timeout, const sigset_t *sigmask)
+int comm_rcv(struct cnid_dbd_rqst *rqst, time_t timeout, const sigset_t *sigmask, time_t *now)
{
char *nametmp;
int b;
- if ((cur_fd = check_fd(timeout, sigmask)) < 0)
+ if ((cur_fd = check_fd(timeout, sigmask, now)) < 0)
return -1;
if (!cur_fd)
/*
- * $Id: comm.h,v 1.4 2009-10-18 17:50:13 didg Exp $
+ * $Id: comm.h,v 1.5 2009-10-19 08:09:07 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
extern int comm_init (struct db_param *, int, int);
-extern int comm_rcv (struct cnid_dbd_rqst *, time_t, const sigset_t *);
+extern int comm_rcv (struct cnid_dbd_rqst *, time_t, const sigset_t *, time_t *);
extern int comm_snd (struct cnid_dbd_rply *);
extern int comm_nbe (void);
/*
- * $Id: main.c,v 1.14 2009-10-19 07:46:35 didg Exp $
+ * $Id: main.c,v 1.15 2009-10-19 08:09:07 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* Copyright (c) Frank Lahm 2009
else
timeout = 1;
- if ((cret = comm_rcv(&rqst, timeout, &set)) < 0)
+ if ((cret = comm_rcv(&rqst, timeout, &set, &now)) < 0)
return -1;
- now = time(NULL);
-
if (cret == 0) {
/* comm_rcv returned from select without receiving anything. */
if (exit_sig) {