<div dir="auto"><div>Thanks Petr for help doing this, I'm on the way to visit Brno. Not convenient to connect internet until next week.</div><div dir="auto"><br></div><div dir="auto">--  sending by my ph1 phone.</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020, 16:14 Petr Vorel <<a href="mailto:pvorel@suse.cz">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank" rel="noreferrer">liwang@redhat.com</a>><br>
<br>
To follow up commit 447c223db ("tst_device: include unistd.h").<br>
<br>
Reported-by: Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank" rel="noreferrer">pvorel@suse.cz</a>><br>
Suggested-by: Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank" rel="noreferrer">chrubis@suse.cz</a>><br>
Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank" rel="noreferrer">liwang@redhat.com</a>><br>
Reviewed-by: Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank" rel="noreferrer">chrubis@suse.cz</a>><br>
[pvorel: Removed _XOPEN_SOURCE from affected tests to really fix<br>
the issue and aren't needed]<br>
Reviewed-by: Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank" rel="noreferrer">pvorel@suse.cz</a>><br>
Tested-by: Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank" rel="noreferrer">pvorel@suse.cz</a>><br>
<br>
Fixes: eca0fa3c3 ("tst_device: add new tst_dev_sync")<br>
Signed-off-by: Petr Vorel <<a href="mailto:pvorel@suse.cz" target="_blank" rel="noreferrer">pvorel@suse.cz</a>><br>
---<br>
Hi,<br>
<br>
tested on<br>
<a href="https://travis-ci.org/pevik/ltp/builds/635305638" rel="noreferrer noreferrer" target="_blank">https://travis-ci.org/pevik/ltp/builds/635305638</a><br>
<br>
Please anybody ack and merge, so we can move on with merging other<br>
things before git freeze.<br>
<br>
NOTE: Debian failures are caused by bug in libtirpc 1.2.5,<br>
will be fixed by <a href="https://patchwork.ozlabs.org/patch/1216506/" rel="noreferrer noreferrer" target="_blank">https://patchwork.ozlabs.org/patch/1216506/</a><br>
<br>
Kind regards,<br>
Petr<br>
<br>
 include/tst_device.h                                | 5 +++--<br>
 testcases/kernel/syscalls/fadvise/posix_fadvise01.c | 1 -<br>
 testcases/kernel/syscalls/fadvise/posix_fadvise02.c | 1 -<br>
 testcases/kernel/syscalls/fadvise/posix_fadvise03.c | 1 -<br>
 testcases/kernel/syscalls/fadvise/posix_fadvise04.c | 1 -<br>
 testcases/kernel/syscalls/pwrite/pwrite02.c         | 2 --<br>
 6 files changed, 3 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/include/tst_device.h b/include/tst_device.h<br>
index f277afd77..3db5275c9 100644<br>
--- a/include/tst_device.h<br>
+++ b/include/tst_device.h<br>
@@ -19,6 +19,7 @@<br>
 #define TST_DEVICE_H__<br>
<br>
 #include <unistd.h><br>
+#include <sys/syscall.h><br>
<br>
 struct tst_device {<br>
        const char *dev;<br>
@@ -75,9 +76,9 @@ int tst_detach_device(const char *dev_path);<br>
  * simply before the tst_dev_bytes_written invocation. For easy to use,<br>
  * we create this inline function tst_dev_sync.<br>
  */<br>
-static inline void tst_dev_sync(int fd)<br>
+static inline int tst_dev_sync(int fd)<br>
 {<br>
-       syncfs(fd);<br>
+       return syscall(__NR_syncfs, fd);<br>
 }<br>
<br>
 /*<br>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c<br>
index 2af040840..71e6454d8 100644<br>
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c<br>
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c<br>
@@ -20,7 +20,6 @@<br>
  *     None<br>
  */<br>
<br>
-#define _XOPEN_SOURCE 600<br>
 #include <fcntl.h><br>
<br>
 #include <unistd.h><br>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c<br>
index d533a7953..303f776e4 100644<br>
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c<br>
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c<br>
@@ -20,7 +20,6 @@<br>
  *     None<br>
  */<br>
<br>
-#define _XOPEN_SOURCE 600<br>
 #include <fcntl.h><br>
 #include <unistd.h><br>
 #include <signal.h><br>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c<br>
index 5bada5f3d..98d8d2930 100644<br>
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c<br>
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c<br>
@@ -20,7 +20,6 @@<br>
  *     None<br>
  */<br>
<br>
-#define _XOPEN_SOURCE 600<br>
 #include <fcntl.h><br>
 #include <unistd.h><br>
 #include <signal.h><br>
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c<br>
index d8d8fb601..f389a219b 100644<br>
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c<br>
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c<br>
@@ -20,7 +20,6 @@<br>
  *     None<br>
  */<br>
<br>
-#define _XOPEN_SOURCE 600<br>
 #include <fcntl.h><br>
 #include <unistd.h><br>
 #include <signal.h><br>
diff --git a/testcases/kernel/syscalls/pwrite/pwrite02.c b/testcases/kernel/syscalls/pwrite/pwrite02.c<br>
index 056d44da2..221904cd7 100644<br>
--- a/testcases/kernel/syscalls/pwrite/pwrite02.c<br>
+++ b/testcases/kernel/syscalls/pwrite/pwrite02.c<br>
@@ -18,8 +18,6 @@<br>
  *      accessible address space, returns EFAULT.<br>
  */<br>
<br>
-#define _XOPEN_SOURCE 500<br>
-<br>
 #include <errno.h><br>
 #include <unistd.h><br>
 #include <string.h><br>
-- <br>
2.24.0<br>
<br>
</blockquote></div></div></div>