Skip to content

Commit b573db4

Browse files
committed
lapi/stat.h: Simplify definition
Reviewed-by: Xiao Yang <[email protected]> Signed-off-by: Yang Xu <[email protected]>
1 parent c67df83 commit b573db4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

include/lapi/stat.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
#include <stdint.h>
1212
#include <unistd.h>
13+
#include <sys/stat.h>
1314
#include "lapi/syscalls.h"
15+
1416
/*
1517
* Timestamp structure for the timestamps in struct statx.
1618
*
@@ -21,9 +23,7 @@
2123
*
2224
* __reserved is held in case we need a yet finer resolution.
2325
*/
24-
#if defined(HAVE_STRUCT_STATX_TIMESTAMP)
25-
#include <sys/stat.h>
26-
#else
26+
#ifndef HAVE_STRUCT_STATX_TIMESTAMP
2727
struct statx_timestamp {
2828
int64_t tv_sec;
2929
uint32_t tv_nsec;
@@ -67,9 +67,7 @@ struct statx_timestamp {
6767
* will have values installed for compatibility purposes so that stat() and
6868
* co. can be emulated in userspace.
6969
*/
70-
#if defined(HAVE_STRUCT_STATX)
71-
#include <sys/stat.h>
72-
#else
70+
#ifndef HAVE_STRUCT_STATX
7371
struct statx {
7472
/* 0x00 */
7573
uint32_t stx_mask;
@@ -102,7 +100,7 @@ struct statx {
102100
};
103101
#endif
104102

105-
#if !defined(HAVE_STATX)
103+
#ifndef HAVE_STATX
106104

107105
/*
108106
* statx: wrapper function of statx

0 commit comments

Comments
 (0)