X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Fafp_dsi.c;h=8b5187b881778ee398e8c4c62ae428eba43e7f01;hp=63d2f286499db68372e57bfa1e285e7fa9273b06;hb=7d4c103bcc2f7f9c60eb431a2770cc26d0056552;hpb=2543f8977bd9392f695a75704ad300958f49ec47 diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 63d2f286..8b5187b8 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -322,9 +324,10 @@ static void alarm_handler(int sig _U_) return; } - if ((err = pollvoltime(AFPobj)) == 0) + if ((err = pollvoltime(AFPobj)) == 0) { LOG(log_debug, logtype_afpd, "afp_alarm: sending DSI tickle"); err = dsi_tickle(AFPobj->dsi); + } if (err <= 0) { if (geteuid() == 0) { LOG(log_note, logtype_afpd, "afp_alarm: unauthenticated user, connection problem"); @@ -336,6 +339,11 @@ static void alarm_handler(int sig _U_) } } +static void child_handler(int sig _U_) +{ + wait(NULL); +} + /* ----------------- if dsi->in_write is set attention, tickle (and close?) msg aren't sent. We don't care about tickle @@ -427,6 +435,17 @@ void afp_over_dsi_sighandlers(AFPObj *obj) afp_dsi_die(EXITERR_SYS); } #endif /* DEBUGGING */ + + /* SIGCHLD */ + action.sa_handler = child_handler; +#ifdef SA_NOCLDWAIT +/* this enhancement simplifies things for Solaris, it also improves performance */ + action.sa_flags |= SA_NOCLDWAIT; +#endif + if (sigaction(SIGCHLD, &action, NULL) < 0 ) { + LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); + afp_dsi_die(EXITERR_SYS); + } } /* ------------------------------------------- @@ -474,10 +493,6 @@ void afp_over_dsi(AFPObj *obj) int flag = 1; setsockopt(dsi->socket, SOL_TCP, TCP_NODELAY, &flag, sizeof(flag)); - /* Initialize Spotlight */ - if ((obj->options.flags & OPTION_SPOTLIGHT) && (obj->options.slmod_path)) - sl_mod_load(obj->options.slmod_path); - ipc_child_state(obj, DSI_RUNNING); /* get stuck here until the end */ @@ -532,7 +547,7 @@ void afp_over_dsi(AFPObj *obj) if (reload_request) { reload_request = 0; - load_volumes(AFPobj); + load_volumes(AFPobj, lv_none); } /* The first SIGINT enables debugging, the next restores the config */