X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fflock.c;h=f15fe12359a97da51e303f7ea6258a333aec438b;hb=fb884a0dca91500cb944b0ecc2e5388fa2c7bcd5;hp=bdec6d48ed62632fa19630d6853d7ce702db7671;hpb=64c79c31f05fe182fa2de40f804b4bdc264fbb17;p=gnulib.git diff --git a/lib/flock.c b/lib/flock.c index bdec6d48e..f15fe1235 100644 --- a/lib/flock.c +++ b/lib/flock.c @@ -6,7 +6,7 @@ Written by Richard W.M. Jones - Copyright (C) 2008-2011 Free Software Foundation, Inc. + Copyright (C) 2008-2013 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,14 +26,14 @@ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* _get_osfhandle */ -#include - /* LockFileEx */ -#define WIN32_LEAN_AND_MEAN -#include +# define WIN32_LEAN_AND_MEAN +# include -#include +# include + +/* _get_osfhandle */ +# include "msvc-nothrow.h" /* Determine the current size of a file. Because the other braindead * APIs we'll call need lower/upper 32 bit pairs, keep the file size @@ -47,9 +47,9 @@ file_size (HANDLE h, DWORD * lower, DWORD * upper) } /* LOCKFILE_FAIL_IMMEDIATELY is undefined on some Windows systems. */ -#ifndef LOCKFILE_FAIL_IMMEDIATELY -# define LOCKFILE_FAIL_IMMEDIATELY 1 -#endif +# ifndef LOCKFILE_FAIL_IMMEDIATELY +# define LOCKFILE_FAIL_IMMEDIATELY 1 +# endif /* Acquire a lock. */ static BOOL @@ -160,17 +160,17 @@ flock (int fd, int operation) #else /* !Windows */ -#ifdef HAVE_STRUCT_FLOCK_L_TYPE +# ifdef HAVE_STRUCT_FLOCK_L_TYPE /* We know how to implement flock in terms of fcntl. */ -#include +# include -#ifdef HAVE_UNISTD_H -#include -#endif +# ifdef HAVE_UNISTD_H +# include +# endif -#include -#include +# include +# include int flock (int fd, int operation) @@ -211,10 +211,10 @@ flock (int fd, int operation) return r; } -#else /* !HAVE_STRUCT_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." +# error "This platform lacks flock function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib." -#endif /* !HAVE_STRUCT_FLOCK_L_TYPE */ +# endif /* !HAVE_STRUCT_FLOCK_L_TYPE */ #endif /* !Windows */