diff mbox series

[v5,3/7] lapi/stat.h: Simplify definition

Message ID 1683623648-22778-3-git-send-email-xuyang2018.jy@fujitsu.com
State Changes Requested
Headers show
Series [v5,1/7] include/lapi: Move AT_* related macros to fcntl header | expand

Commit Message

Yang Xu May 9, 2023, 9:14 a.m. UTC
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 include/lapi/stat.h | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/include/lapi/stat.h b/include/lapi/stat.h
index 6ed4b6637..e247c2159 100644
--- a/include/lapi/stat.h
+++ b/include/lapi/stat.h
@@ -11,6 +11,8 @@ 
 #include <stdint.h>
 #include <unistd.h>
 #include "lapi/syscalls.h"
+#include <sys/stat.h>
+
 /*
  * Timestamp structure for the timestamps in struct statx.
  *
@@ -21,9 +23,7 @@ 
  *
  * __reserved is held in case we need a yet finer resolution.
  */
-#if defined(HAVE_STRUCT_STATX_TIMESTAMP)
-#include <sys/stat.h>
-#else
+#ifndef HAVE_STRUCT_STATX_TIMESTAMP
 struct statx_timestamp {
 	int64_t tv_sec;
 	uint32_t tv_nsec;
@@ -67,9 +67,7 @@  struct statx_timestamp {
  * will have values installed for compatibility purposes so that stat() and
  * co. can be emulated in userspace.
  */
-#if defined(HAVE_STRUCT_STATX)
-#include <sys/stat.h>
-#else
+#ifndef HAVE_STRUCT_STATX
 struct statx {
 	/* 0x00 */
 	uint32_t	stx_mask;
@@ -106,8 +104,7 @@  struct statx {
 };
 #endif
 
-#if !defined(HAVE_STATX)
-
+#ifndef HAVE_STATX
 /*
  * statx: wrapper function of statx
  *