samples: Make fs-monitor depend on libc and headers

[ Upstream commit 8fc70b3a142f97f7859bf052151df896933d2586 ]

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>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Gabriel Krisman Bertazi 2024-07-25 11:32:28 -04:00 committed by Ksawlii
parent 3f87b263a5
commit 7b04731df2

View 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