- static int saved_ipcfd = -1;
- if (saved_ipcfd == -1)
- saved_ipcfd = obj->ipc_fd;
- if (poll(pollfds, 1, 0) == 1) {
- if (pollfds[0].revents & (POLLHUP | POLLERR)) {
- if (saved_ipcfd == obj->ipc_fd && getppid() == 1) {
- close(obj->ipc_fd);
- sleep(30); /* give it enough time to start */
- if ((obj->ipc_fd = ipc_client_uds(_PATH_AFP_IPC)) == -1) {
- LOG(log_error, logtype_afpd, "afp_over_dsi: cant reconnect to master");
- afp_dsi_die(EXITERR_SYS);
- }
- }
+ if (dsi->flags & DSI_RECONINPROG) {
+ LOG(log_note, logtype_afpd, "afp_over_dsi: failed reconnect");
+ afp_dsi_close(obj);
+ exit(0);