summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorKarel Zak2014-11-21 11:38:11 +0100
committerKarel Zak2014-11-21 11:38:11 +0100
commit90d5285d8c21897d3fc0caed4691c88f15d0131b (patch)
tree9640b41b414009e4d4b1cdf842536d74ef219158 /term-utils/agetty.c
parentlibfdisk: add ref.counting to ask API (diff)
downloadkernel-qcow2-util-linux-90d5285d8c21897d3fc0caed4691c88f15d0131b.tar.gz
kernel-qcow2-util-linux-90d5285d8c21897d3fc0caed4691c88f15d0131b.tar.xz
kernel-qcow2-util-linux-90d5285d8c21897d3fc0caed4691c88f15d0131b.zip
agetty: use futimens, check for all in configure.ac
It seems better to warn about --reload in ./configure if futimens or inotify_init1 are missing. The patch also replaces futimes() with futimens() to make the code compatible with Uclibc. Addresses: https://github.com/karelzak/util-linux/issues/133 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index f7ae570fb..9871a3685 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -126,12 +126,6 @@
/*
* agetty --reload
*/
-#define AGETTY_RELOAD /* enabled by default */
-
-#ifndef HAVE_INOTIFY_INIT1
-# undef AGETTY_RELOAD /* disable on systems without inotify */
-#endif
-
#ifdef AGETTY_RELOAD
# include <sys/inotify.h>
# define AGETTY_RELOAD_FILENAME "/run/agetty.reload" /* trigger file */
@@ -2499,7 +2493,7 @@ static void reload_agettys(void)
if (fd < 0)
err(EXIT_FAILURE, _("cannot open: %s"), AGETTY_RELOAD_FILENAME);
- if (futimes(fd, NULL) < 0 || close(fd) < 0)
+ if (futimens(fd, NULL) < 0 || close(fd) < 0)
err(EXIT_FAILURE, _("cannot touch file: %s"),
AGETTY_RELOAD_FILENAME);
#else