From bdf01eb1c70d16bfaa72715b2c2a125be61eed85 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Thu, 18 Dec 2008 19:30:16 +0100 Subject: [PATCH] flock: Fix trivial mistakes. --- ChangeLog | 12 ++++++++++++ lib/flock.c | 9 ++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63635fe55..dc16a03f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-12-18 Simon Josefsson + + * lib/flock.c: Use proper #if symbol in check. Reported by "Tom + G. Christensen" . + + * lib/flock.c: Need to include errno.h. Reported by "Tom + G. Christensen" . + + * lib/flock.c: Need to include string.h. Reported by "Tom + G. Christensen" and Eric Blake + . + 2008-12-18 Bruno Haible * m4/locale-ja.m4: New file, from GNU gettext. diff --git a/lib/flock.c b/lib/flock.c index 5aa7690bd..01bfd17aa 100644 --- a/lib/flock.c +++ b/lib/flock.c @@ -160,7 +160,7 @@ flock (int fd, int operation) #else /* !Windows */ -#ifdef HAVE_FLOCK_L_TYPE +#ifdef HAVE_STRUCT_FLOCK_L_TYPE /* We know how to implement flock in terms of fcntl. */ #ifdef HAVE_FCNTL_H @@ -171,6 +171,9 @@ flock (int fd, int operation) #include #endif +#include +#include + int flock (int fd, int operation) { @@ -210,10 +213,10 @@ flock (int fd, int operation) return r; } -#else /* !HAVE_FLOCK_L_TYPE */ +#else /* !HAVE_STRUCT_FLOCK_L_TYPE */ #error "This platform lacks flock function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib." -#endif /* !HAVE_FLOCK_L_TYPE */ +#endif /* !HAVE_STRUCT_FLOCK_L_TYPE */ #endif /* !Windows */ -- 2.11.0