Version 2.02.120 -
===============================
+ Fix some libdaemon socket creation and reuse error paths.
Daemons (libdaemon) support exit on idle also in non-systemd environment.
Provide make dist and make rpm targets
Configure lvm.conf for use_lvmetad and use_lvmpolld.
}
/* Socket already exists. If it's stale, remove it. */
- if (stat(sockaddr.sun_path, &buf)) {
+ if (lstat(sockaddr.sun_path, &buf)) {
perror("stat failed");
goto error;
}
- if (S_ISSOCK(buf.st_mode)) {
+ if (!S_ISSOCK(buf.st_mode)) {
fprintf(stderr, "%s: not a socket\n", sockaddr.sun_path);
goto error;
}
}
/* Set Close-on-exec */
- if (fcntl(s.socket_fd, F_SETFD, 1))
+ if (!failed && fcntl(s.socket_fd, F_SETFD, 1))
fprintf(stderr, "setting CLOEXEC on socket fd %d failed: %s\n", s.socket_fd, strerror(errno));
/* Signal parent, letting them know we are ready to go. */