/* static variables */
static AFPObj obj;
-static sig_atomic_t got_chldsig;
static pid_t afpd_pid = -1, cnid_metad_pid = -1;
static uint afpd_restarts, cnid_metad_restarts;
static struct event_base *base;
/* SIGCHLD callback */
static void sigchld_cb(evutil_socket_t fd, short what, void *arg)
{
- int status, i;
+ int status;
pid_t pid;
LOG(log_debug, logtype_afpd, "Got SIGCHLD event");
/* timer callback */
static void timer_cb(evutil_socket_t fd, short what, void *arg)
{
- static int i = 0;
-
if (in_shutdown)
return;
/* this get called when error conditions are met that require us to exit gracefully */
static void netatalk_exit(int ret)
{
- server_unlock(_PATH_NETATALK_LOCK);
+ server_unlock(PATH_NETATALK_LOCK);
exit(ret);
}
int main(int argc, char **argv)
{
- const char *configfile = NULL;
int c, ret, debug = 0;
sigset_t blocksigs;
struct timeval tv;
}
}
- if (check_lockfile("netatalk", _PATH_NETATALK_LOCK) != 0)
+ if (check_lockfile("netatalk", PATH_NETATALK_LOCK) != 0)
exit(EXITERR_SYS);
if (!debug && daemonize(0, 0) != 0)
exit(EXITERR_SYS);
- if (create_lockfile("netatalk", _PATH_NETATALK_LOCK) != 0)
+ if (create_lockfile("netatalk", PATH_NETATALK_LOCK) != 0)
exit(EXITERR_SYS);
sigfillset(&blocksigs);
LOG(log_note, logtype_default, "Netatalk AFP server starting");
if ((afpd_pid = run_process(_PATH_AFPD, "-d", "-F", obj.options.configfile, NULL)) == -1) {
- LOG(log_error, logtype_afpd, "Error starting 'cnid_metad'");
+ LOG(log_error, logtype_afpd, "Error starting 'afpd'");
netatalk_exit(EXITERR_CONF);
}