/opt
DOC "Path where the libutil library can be found")
IF(LIBUTIL_LIBRARY)
- LIST(APPEND CMAKE_REQUIRED_LIBRARIES util)
- CHECK_FUNCTION_EXISTS(pidfile_open HAVE_PIDFILE)
- CHECK_FUNCTION_EXISTS(pidfile_fileno HAVE_PIDFILE_FILENO)
-
FIND_FILE(HAVE_LIBUTIL_H NAMES libutil.h PATHS /usr/include
/opt/include
/usr/local/include
DOC "Path to libutil header")
+ IF(HAVE_LIBUTIL_H)
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES util)
+ CHECK_FUNCTION_EXISTS(pidfile_open HAVE_PIDFILE)
+ CHECK_FUNCTION_EXISTS(pidfile_fileno HAVE_PIDFILE_FILENO)
+ ENDIF(HAVE_LIBUTIL_H)
ENDIF(LIBUTIL_LIBRARY)
# Find libfetch (for FreeBSD)
gchar *end, *p, ch;
restart:
- if ((input = output = open (_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) {
+ if ((input = output = open (_PATH_TTY, O_RDWR)) == -1) {
errno = ENOTTY;
return 0;
}
+ if (fcntl (input, F_SETFD, FD_CLOEXEC) == -1) {
+ msg_warn ("fcntl failed: %d, '%s'", errno, strerror (errno));
+ }
/* Turn echo off */
if (tcgetattr (input, &oterm) != 0) {