tst_device.h: Use <sys/syscall.h> and fallback to sync()
PATCH 1/1 tst_device.h: Use <sys/syscall.h> and fallback to sync()
This partly reverts commit 9e83513eb, which unconditionally included lapi/syscalls.h. Put back <sys/syscall.h> and fallback to sync() for these rare cases where __NR_syncfs.
Hope this is final fix for syncfs() issues.
Fixes 9e83513eb "tst_device.h: Use lapi/syscalls.h instead of <sys/syscall.h>"
Signed-off-by Petr Vorel <[email protected]>
--- include/tst_device.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
include/tst_device.h +6 -1
@@ -19,7 +19,7 @@#define TST_DEVICE_H__ #include <unistd.h> -#include "lapi/syscalls.h" +#include <sys/syscall.h> struct tst_device {const char *dev;
@@ -78,7 +78,12 @@ int tst_detach_device(const char *dev_path);*/ static inline int tst_dev_sync (int fd) { +#ifdef __NR_syncfsreturn syscall (__NR_syncfs, fd); +#else +sync (); +return 0 ; +#endif }/*
Signature · 1 line
2.24.1
PATCH 1/1 tst_device.h: Use <sys/syscall.h> and fallback to sync()
Hi!
I would rather fix the socketcall tests, I do not thing that anything else would break.
Signature · 2 lines
Cyril Hrubis [email protected]