diff options
author | Jim Meyering <meyering@redhat.com> | 2011-02-20 23:02:43 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-02-22 14:51:31 +0100 |
commit | 86fd2114ac3940e03a02e99658c8df88aed8a235 (patch) | |
tree | 988f6343a71b4ef30052c959109289c9d6ae8a75 /lib/flock.c | |
parent | f1eb357fab17482b2d19f12fc731673acead4922 (diff) | |
download | gnulib-86fd2114ac3940e03a02e99658c8df88aed8a235.tar.gz |
maint: adjust cpp indentation to reflect nesting depth
I.e., in a block of code that begins with an unnested "#if",
put one space between the "#" in column 1 and following token.
For example,
-#include <sys/vfs.h>
+# include <sys/vfs.h>
Do this only in .c files that are part of a module I maintain.
* lib/linkat.c: Filter through cppi.
* lib/nanosleep.c: Likewise.
* lib/openat.c: Likewise.
* lib/openat-die.c: Likewise.
* lib/dup3.c: Likewise.
* lib/fchownat.c: Likewise.
* lib/flock.c: Likewise.
* lib/fsync.c: Likewise.
* lib/fts.c: Likewise.
* lib/getpass.c: Likewise.
* lib/gettimeofday.c: Likewise.
* lib/userspec.c: Likewise.
* Makefile (sc_cpp_indent_check): New rule, to check this.
Diffstat (limited to 'lib/flock.c')
-rw-r--r-- | lib/flock.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/flock.c b/lib/flock.c index bdec6d48ed..8f018e50c9 100644 --- a/lib/flock.c +++ b/lib/flock.c @@ -27,13 +27,13 @@ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* _get_osfhandle */ -#include <io.h> +# include <io.h> /* LockFileEx */ -#define WIN32_LEAN_AND_MEAN -#include <windows.h> +# define WIN32_LEAN_AND_MEAN +# include <windows.h> -#include <errno.h> +# include <errno.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 <fcntl.h> +# include <fcntl.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif -#include <errno.h> -#include <string.h> +# include <errno.h> +# include <string.h> 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 */ |