The struct issue nl field and related helper functions use types
and headers (netaddrq.h, linux/netlink.h) that are only available
when AGETTY_RELOAD is defined. Guard the .nl.fd initializations
in main() and show_issue(), and wrap the netlink helper functions
(print_iface_best, print_addrq_bestofall, dump_iface_good,
dump_iface_all) with #ifdef AGETTY_RELOAD.
This fixes compilation on systems without inotify/netlink support
(e.g., GNU/Hurd).
Co-authored-by: Samuel Thibault <samuel.thibault@aquilenet.fr>
Signed-off-by: Karel Zak <kzak@redhat.com>
};
struct issue issue = {
.mem = NULL,
+#ifdef AGETTY_RELOAD
.nl.fd = -1
+#endif
};
char *login_argv[LOGIN_ARGV_MAX + 1];
int login_argc = 0;
*/
static void show_issue(struct options *op)
{
- struct issue ie = { .output = NULL, .nl.fd = -1 };
+ struct issue ie = {
+ .output = NULL,
+#ifdef AGETTY_RELOAD
+ .nl.fd = -1
+#endif
+ };
struct termios tp;
memset(&tp, 0, sizeof(struct termios));
va_end(ap);
}
+#ifdef AGETTY_RELOAD
static void print_iface_best(struct issue *ie,
const char *ifname,
uint8_t ifa_family)
if (!first)
fputs("\n", ie->output);
}
+#endif /* AGETTY_RELOAD */
/*
* parses \x{argument}, if not argument specified then returns NULL, the @fd