From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 1/3] lib: add helper SAFE_FANOTIFY_INIT
Date: Fri, 18 Aug 2017 12:22:52 +0200 [thread overview]
Message-ID: <20170818102252.GA22319@rei.lan> (raw)
In-Reply-To: <1502867737-26158-2-git-send-email-xzhou@redhat.com>
Hi!
Pushed with following patch (to fix warnings), thanks.
diff --git a/lib/tst_safe_macros.c b/lib/tst_safe_macros.c
index ecd39f8bc..d4d81c6cd 100644
--- a/lib/tst_safe_macros.c
+++ b/lib/tst_safe_macros.c
@@ -18,6 +18,10 @@
#define _GNU_SOURCE
#include <unistd.h>
#include <errno.h>
+#include "config.h"
+#ifdef HAVE_SYS_FANOTIFY_H
+# include <sys/fanotify.h>
+#endif
#define TST_NO_DEFAULT_MAIN
#include "tst_test.h"
#include "tst_safe_macros.h"
@@ -54,10 +58,10 @@ int safe_fanotify_init(const char *file, const int lineno,
{
int rval;
+#ifdef HAVE_SYS_FANOTIFY_H
rval = fanotify_init(flags, event_f_flags);
if (rval == -1) {
-
if (errno == ENOSYS) {
tst_brk(TCONF,
"fanotify is not configured in this kernel.");
@@ -65,6 +69,9 @@ int safe_fanotify_init(const char *file, const int lineno,
tst_brk(TBROK | TERRNO,
"%s:%d: fanotify_init() failed", file, lineno);
}
+#else
+ tst_brk(TCONF, "Header <sys/fanotify.h> is not present");
+#endif /* HAVE_SYS_FANOTIFY_H */
return rval;
}
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-08-18 10:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 9:24 [LTP] [PATCH] syscalls/fanotify08: add sanity check for FAN_CLOEXEC Xiong Zhou
2017-06-05 14:03 ` Cyril Hrubis
2017-08-11 3:13 ` [LTP] [PATCH v2] " Xiong Zhou
2017-08-11 8:41 ` Cyril Hrubis
2017-08-14 14:01 ` [LTP] [PATCH v3 0/3] add SAFE_FANOTIFY_INIT and FAN_CLOEXEC cases Xiong Zhou
2017-08-14 14:01 ` [LTP] [PATCH v3 1/3] lib: add helper SAFE_FANOTIFY_INIT Xiong Zhou
2017-08-15 13:23 ` Cyril Hrubis
2017-08-14 14:01 ` [LTP] [PATCH v3 2/3] fanotify: rewrite old cases with new lib Xiong Zhou
2017-08-15 13:33 ` Cyril Hrubis
2017-08-14 14:01 ` [LTP] [PATCH v3 3/3] syscalls/fanotify0[89]: add sanity check for FAN_CLOEXEC Xiong Zhou
2017-08-15 13:36 ` Cyril Hrubis
2017-08-16 7:15 ` [LTP] [PATCH v4 0/3] add SAFE_FANOTIFY_INIT and FAN_CLOEXEC check Xiong Zhou
2017-08-16 7:15 ` [LTP] [PATCH v4 1/3] lib: add helper SAFE_FANOTIFY_INIT Xiong Zhou
2017-08-18 10:22 ` Cyril Hrubis [this message]
2017-08-21 3:12 ` Xiong Zhou
2017-08-21 11:45 ` Cyril Hrubis
2017-08-16 7:15 ` [LTP] [PATCH v4 2/3] fanotify: rewrite old cases with new lib Xiong Zhou
2017-08-18 10:24 ` Cyril Hrubis
2017-08-16 7:15 ` [LTP] [PATCH v4 3/3] syscalls/fanotify08: add sanity check for FAN_CLOEXEC Xiong Zhou
2017-08-18 10:25 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170818102252.GA22319@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox