samples: Make fs-monitor depend on libc and headers
authorGabriel Krisman Bertazi <krisman@collabora.com>
Thu, 28 Oct 2021 18:56:28 +0000 (15:56 -0300)
committerJan Kara <jack@suse.cz>
Mon, 1 Nov 2021 11:39:53 +0000 (12:39 +0100)
Prevent build errors when headers or libc are not available, such as on
kernel build bots, like the below:

samples/fanotify/fs-monitor.c:7:10: fatal error: errno.h: No such file
or directory
  7 | #include <errno.h>
    |          ^~~~~~~~~

Link: https://lore.kernel.org/r/87fsslasgz.fsf@collabora.com
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Jan Kara <jack@suse.cz>
samples/Kconfig

index 88353b8eac0b48b5ae05ee85dff808c1fcde5e08..56539b21f2c73e220ede3b6a86d41c1ae88556de 100644 (file)
@@ -122,7 +122,7 @@ config SAMPLE_CONNECTOR
 
 config SAMPLE_FANOTIFY_ERROR
        bool "Build fanotify error monitoring sample"
-       depends on FANOTIFY
+       depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL
        help
          When enabled, this builds an example code that uses the
          FAN_FS_ERROR fanotify mechanism to monitor filesystem