X-Git-Url: https://arthur.barton.de/gitweb/?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Fafp_dsi.c;h=eb7f796e19ca366fb09f7d8b2dfd15ad443e34af;hp=697aa435c9a06f4274516f29fe472e42a184bf79;hb=d3dff4ba4b8db3131a16641d35a6554be5fb5160;hpb=3a84db87064922ad10ac10cc1d6833380e575995 diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 697aa435..eb7f796e 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -337,6 +337,11 @@ static void alarm_handler(int sig _U_) } } +static void child_handler(void) +{ + wait(NULL); +} + /* ----------------- if dsi->in_write is set attention, tickle (and close?) msg aren't sent. We don't care about tickle @@ -428,6 +433,17 @@ void afp_over_dsi_sighandlers(AFPObj *obj) afp_dsi_die(EXITERR_SYS); } #endif /* DEBUGGING */ + + /* SIGCLD */ + 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(SIGCLD, &action, NULL) < 0 ) { + LOG(log_error, logtype_afpd, "afp_over_dsi: sigaction: %s", strerror(errno) ); + afp_dsi_die(EXITERR_SYS); + } } /* -------------------------------------------