# HG changeset patch # User Simon Josefsson # Date 1229625016 -3600 # Node ID 81b06acec5ca3d40b3a349dc96e2143920ada6af # Parent ab686952f5d83c436ebd3743b1d03fa81471fb72 flock: Fix trivial mistakes. diff --git a/ChangeLog b/ChangeLog --- 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 --- a/lib/flock.c +++ b/lib/flock.c @@ -160,7 +160,7 @@ #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 @@ #include #endif +#include +#include + int flock (int fd, int operation) { @@ -210,10 +213,10 @@ 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 */