Mercurial > hg > octave-lyh > gnulib-hg
changeset 10903:81b06acec5ca
flock: Fix trivial mistakes.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Thu, 18 Dec 2008 19:30:16 +0100 |
parents | ab686952f5d8 |
children | f3a8426d168e |
files | ChangeLog lib/flock.c |
diffstat | 2 files changed, 18 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-12-18 Simon Josefsson <simon@josefsson.org> + + * lib/flock.c: Use proper #if symbol in check. Reported by "Tom + G. Christensen" <tgc@jupiterrise.com>. + + * lib/flock.c: Need to include errno.h. Reported by "Tom + G. Christensen" <tgc@jupiterrise.com>. + + * lib/flock.c: Need to include string.h. Reported by "Tom + G. Christensen" <tgc@jupiterrise.com> and Eric Blake + <ebb9@byu.net>. + 2008-12-18 Bruno Haible <bruno@clisp.org> * m4/locale-ja.m4: New file, from GNU gettext.
--- 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 <unistd.h> #endif +#include <errno.h> +#include <string.h> + 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 */