/*
- * $Id: afp_dsi.c,v 1.33 2008-12-03 18:35:44 didg Exp $
+ * $Id: afp_dsi.c,v 1.39 2009-10-14 01:38:28 didg Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
#include "uid.h"
#endif /* FORCE_UIDGID */
-extern struct oforks *writtenfork;
-
#define CHILD_DIE (1 << 0)
#define CHILD_RUNNING (1 << 1)
#define CHILD_SLEEPING (1 << 2)
if (obj->logout)
(*obj->logout)();
- /* UAM had syslog control; afpd needs to reassert itself */
- set_processname("afpd");
- syslog_setup(log_debug, logtype_default, logoption_ndelay | logoption_pid, logfacility_daemon);
LOG(log_info, logtype_afpd, "%.2fKB read, %.2fKB written",
dsi->read_count/1024.0, dsi->write_count/1024.0);
}
/* ------------------- */
-static void afp_dsi_timedown()
+static void afp_dsi_timedown(int sig _U_)
{
struct sigaction sv;
struct itimerval it;
*/
volatile int reload_request = 0;
-static void afp_dsi_reload()
+static void afp_dsi_reload(int sig _U_)
{
reload_request = 1;
}
}
#endif /* SERVERTEXT */
-static void alarm_handler()
+static void alarm_handler(int sig _U_)
{
int err;
u_int32_t err, cmd;
u_int8_t function;
struct sigaction action;
+ const char *afpcmpstr;
obj->exit = afp_dsi_die;
obj->reply = (int (*)()) dsi_cmdreply;
afp_dsi_die(EXITERR_SYS);
}
+#ifndef DEBUGGING
/* tickle handler */
action.sa_handler = alarm_handler;
sigemptyset(&action.sa_mask);
(setitimer(ITIMER_REAL, &dsi->timer, NULL) < 0)) {
afp_dsi_die(EXITERR_SYS);
}
+#endif /* DEBUGGING */
#ifdef DEBUG1
fault_setup((void (*)(void *))afp_dsi_die);
dsi_tickle(dsi);
continue;
} else if (!(child.flags & CHILD_DIE)) { /* reset tickle timer */
+#ifndef DEBUGGING
setitimer(ITIMER_REAL, &dsi->timer, NULL);
+#endif
}
switch(cmd) {
case DSIFUNC_CLOSE:
dsi->datalen = DSI_DATASIZ;
child.flags |= CHILD_RUNNING;
+ afpcmpstr = AfpNum2name(function);
+ LOG(log_debug, logtype_afpd, "=> Start AFP command: %s", afpcmpstr);
+
err = (*afp_switch[function])(obj,
dsi->commands, dsi->cmdlen,
dsi->data, &dsi->datalen);
+
+ LOG(log_debug, logtype_afpd, "=> Finished AFP command: %s", afpcmpstr);
#ifdef FORCE_UIDGID
/* bring everything back to old euid, egid */
- if (obj->force_uid)
+ if (obj->force_uid)
restore_uidgid ( &obj->uidgid );
#endif /* FORCE_UIDGID */
child.flags &= ~CHILD_RUNNING;