public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] fanotify: Test with tst_variant both raw syscall and libc
Date: Wed, 29 Apr 2020 14:06:11 +0200	[thread overview]
Message-ID: <20200429120611.GA10236@dell5510> (raw)
In-Reply-To: <CAOQ4uxjJ7qFZVf4YNNK=JYDSc=_+fRoU6v+OAwQ3Vp7soNSAbQ@mail.gmail.com>

Hi Amir,

> My confusion is because you removed the HAVE_SYS_FANOTIFY_H ifdef
> and now you include sys/fanotify.h unconditionally.
> So I meant if this code builds with all supported system configurations.
Thanks! I overlook an obvious error. Patch is wrong, because fanotify.h must be
included in tests below #if defined(HAVE_SYS_FANOTIFY_H).
Below is fix to posted patch, tested without <sys/fanotify.h>.

Kind regards,
Petr

diff --git testcases/kernel/syscalls/fanotify/fanotify01.c testcases/kernel/syscalls/fanotify/fanotify01.c
index 77c18e67f..83bcfccb4 100644
--- testcases/kernel/syscalls/fanotify/fanotify01.c
+++ testcases/kernel/syscalls/fanotify/fanotify01.c
@@ -18,10 +18,10 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify02.c testcases/kernel/syscalls/fanotify/fanotify02.c
index 32c842804..eedf00105 100644
--- testcases/kernel/syscalls/fanotify/fanotify02.c
+++ testcases/kernel/syscalls/fanotify/fanotify02.c
@@ -18,10 +18,10 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify03.c testcases/kernel/syscalls/fanotify/fanotify03.c
index fdb0d0f58..cf7b30800 100644
--- testcases/kernel/syscalls/fanotify/fanotify03.c
+++ testcases/kernel/syscalls/fanotify/fanotify03.c
@@ -22,10 +22,10 @@
 #include <sys/syscall.h>
 #include <stdlib.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify04.c testcases/kernel/syscalls/fanotify/fanotify04.c
index 8b738b3ae..725162f5b 100644
--- testcases/kernel/syscalls/fanotify/fanotify04.c
+++ testcases/kernel/syscalls/fanotify/fanotify04.c
@@ -19,10 +19,10 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify05.c testcases/kernel/syscalls/fanotify/fanotify05.c
index 24edec19c..97c921886 100644
--- testcases/kernel/syscalls/fanotify/fanotify05.c
+++ testcases/kernel/syscalls/fanotify/fanotify05.c
@@ -22,10 +22,10 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define MOUNT_PATH "fs_mnt"
 
diff --git testcases/kernel/syscalls/fanotify/fanotify06.c testcases/kernel/syscalls/fanotify/fanotify06.c
index 85dbe5b82..5aea43e33 100644
--- testcases/kernel/syscalls/fanotify/fanotify06.c
+++ testcases/kernel/syscalls/fanotify/fanotify06.c
@@ -36,10 +36,10 @@
 #include <sys/mount.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify07.c testcases/kernel/syscalls/fanotify/fanotify07.c
index be42d1a0b..81fe8f443 100644
--- testcases/kernel/syscalls/fanotify/fanotify07.c
+++ testcases/kernel/syscalls/fanotify/fanotify07.c
@@ -30,10 +30,10 @@
 #include <sys/syscall.h>
 #include "tst_test.h"
 #include "lapi/syscalls.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define BUF_SIZE 256
 static char fname[BUF_SIZE];
diff --git testcases/kernel/syscalls/fanotify/fanotify08.c testcases/kernel/syscalls/fanotify/fanotify08.c
index b61a5509a..b40f95cc9 100644
--- testcases/kernel/syscalls/fanotify/fanotify08.c
+++ testcases/kernel/syscalls/fanotify/fanotify08.c
@@ -18,10 +18,10 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 static int fd_notify;
 
diff --git testcases/kernel/syscalls/fanotify/fanotify09.c testcases/kernel/syscalls/fanotify/fanotify09.c
index a023cd8f6..4e2c6f3e1 100644
--- testcases/kernel/syscalls/fanotify/fanotify09.c
+++ testcases/kernel/syscalls/fanotify/fanotify09.c
@@ -33,10 +33,10 @@
 #include <sys/syscall.h>
 #include <stdint.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify10.c testcases/kernel/syscalls/fanotify/fanotify10.c
index eb7e4efcf..cbef4b943 100644
--- testcases/kernel/syscalls/fanotify/fanotify10.c
+++ testcases/kernel/syscalls/fanotify/fanotify10.c
@@ -30,10 +30,10 @@
 #include <sys/mount.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 /* size of the event structure, not counting name */
diff --git testcases/kernel/syscalls/fanotify/fanotify11.c testcases/kernel/syscalls/fanotify/fanotify11.c
index b8da46eff..de72d10ef 100644
--- testcases/kernel/syscalls/fanotify/fanotify11.c
+++ testcases/kernel/syscalls/fanotify/fanotify11.c
@@ -29,10 +29,10 @@
 #include <linux/limits.h>
 #include "tst_test.h"
 #include "tst_safe_pthread.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define gettid() syscall(SYS_gettid)
 static int tid;
diff --git testcases/kernel/syscalls/fanotify/fanotify12.c testcases/kernel/syscalls/fanotify/fanotify12.c
index 24fb712d4..916444f78 100644
--- testcases/kernel/syscalls/fanotify/fanotify12.c
+++ testcases/kernel/syscalls/fanotify/fanotify12.c
@@ -21,10 +21,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 1024
 #define EVENT_SIZE (sizeof (struct fanotify_event_metadata))
diff --git testcases/kernel/syscalls/fanotify/fanotify13.c testcases/kernel/syscalls/fanotify/fanotify13.c
index 065aac646..0fc82d6df 100644
--- testcases/kernel/syscalls/fanotify/fanotify13.c
+++ testcases/kernel/syscalls/fanotify/fanotify13.c
@@ -25,10 +25,10 @@
 #include <errno.h>
 #include <unistd.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define PATH_LEN 128
 #define BUF_SIZE 256
diff --git testcases/kernel/syscalls/fanotify/fanotify14.c testcases/kernel/syscalls/fanotify/fanotify14.c
index d78c3f3ca..85c6cf401 100644
--- testcases/kernel/syscalls/fanotify/fanotify14.c
+++ testcases/kernel/syscalls/fanotify/fanotify14.c
@@ -12,12 +12,12 @@
  */
 #define _GNU_SOURCE
 #include "tst_test.h"
-#include "fanotify.h"
 
 #include <errno.h>
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define MNTPOINT "mntpoint"
 #define FILE1 MNTPOINT"/file1"
diff --git testcases/kernel/syscalls/fanotify/fanotify15.c testcases/kernel/syscalls/fanotify/fanotify15.c
index 7aebe19c7..39c2c9275 100644
--- testcases/kernel/syscalls/fanotify/fanotify15.c
+++ testcases/kernel/syscalls/fanotify/fanotify15.c
@@ -24,10 +24,10 @@
 #include <sys/types.h>
 
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 10
 
diff --git testcases/kernel/syscalls/fanotify/fanotify16.c testcases/kernel/syscalls/fanotify/fanotify16.c
index 35729aa7b..66dd4057d 100644
--- testcases/kernel/syscalls/fanotify/fanotify16.c
+++ testcases/kernel/syscalls/fanotify/fanotify16.c
@@ -19,11 +19,11 @@
 #include <sys/mount.h>
 #include <sys/syscall.h>
 #include "tst_test.h"
-#include "fanotify.h"
 
 #if defined(HAVE_SYS_FANOTIFY_H)
 #include <sys/fanotify.h>
 #include <sys/inotify.h>
+#include "fanotify.h"
 
 #define EVENT_MAX 10
 

  reply	other threads:[~2020-04-29 12:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 11:35 [LTP] [PATCH 1/2] fanotify: Move safe_fanotify_init() + safe macro into fanotify.h Petr Vorel
2020-04-28 11:35 ` [LTP] [PATCH 2/2] fanotify: Test with tst_variant both raw syscall and libc Petr Vorel
2020-04-28 13:26   ` Amir Goldstein
2020-04-28 13:37     ` Petr Vorel
2020-04-28 15:18       ` Amir Goldstein
2020-04-29 12:06         ` Petr Vorel [this message]
2020-04-29 14:27           ` Amir Goldstein
2020-10-14 13:49   ` Cyril Hrubis
2020-10-14 17:56     ` Petr Vorel
2020-10-14 13:46 ` [LTP] [PATCH 1/2] fanotify: Move safe_fanotify_init() + safe macro into fanotify.h Cyril Hrubis
2020-10-14 18:02   ` Petr Vorel
2020-10-16  3:20     ` Li Wang
2020-10-16 11:35       ` Petr Vorel

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=20200429120611.GA10236@dell5510 \
    --to=pvorel@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