This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] io: include typesizes.h before using macro __OFF_T_MATCHES_OFF64_T
- From: Vincent Chen <vincentc at andestech dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: <deanbo422 at gmail dot com>, Vincent Chen <vincentc at andestech dot com>
- Date: Thu, 27 Jun 2019 23:40:29 +0800
- Subject: [PATCH] io: include typesizes.h before using macro __OFF_T_MATCHES_OFF64_T
The macro __OFF_T_MATCHES_OFF64_T is defined in typesizes.h if the
data type of off_t is the same as off64_t. Hence the condition
"#ifndef __OFF_T_MATCHES_OFF64_T" will be valid when the header file
typesizes.h is included.
---
ChangeLog | 5 +++++
io/lockf.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c10f372..57e87cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-06-27 Vincentc Chen <vincentc@andestech.com>
+
+ * io/lockf.c: include typesizes.h before using macro
+ __OFF_T_MATCHES_OFF64_T.
+
2019-06-26 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/dl-lookupcfg.h: Moved to ...
diff --git a/io/lockf.c b/io/lockf.c
index d40aa88..a8a8530 100644
--- a/io/lockf.c
+++ b/io/lockf.c
@@ -15,12 +15,12 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef __OFF_T_MATCHES_OFF64_T
-
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#ifndef __OFF_T_MATCHES_OFF64_T
+
/* lockf is a simplified interface to fcntl's locking facilities. */
int
lockf (int fd, int cmd, off_t len)
--
2.7.4