diff options
author | David Shaw <[email protected]> | 2003-05-24 16:53:14 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2003-05-24 16:53:14 +0000 |
commit | c84fdfbe620ed3e9d4d3f6c03b3fcea8a1685c72 (patch) | |
tree | dc24a02a957c942f43de558c2424dc897d7f1345 /util/dotlock.c | |
parent | * cipher.h, i18n.h, iobuf.h, memory.h, mpi.h, types.h, util.h: Edit all (diff) | |
download | gnupg-c84fdfbe620ed3e9d4d3f6c03b3fcea8a1685c72.tar.gz gnupg-c84fdfbe620ed3e9d4d3f6c03b3fcea8a1685c72.zip |
* argparse.c, dotlock.c, fileutil.c, iobuf.c, miscutil.c,
simple-gettext.c, errors.c, http.c, memory.c, secmem.c, ttyio.c: Edit all
preprocessor instructions to remove whitespace before the '#'. This is
not required by C89, but there are some compilers out there that don't
like it.
Diffstat (limited to '')
-rw-r--r-- | util/dotlock.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/util/dotlock.c b/util/dotlock.c index 42d06c7b4..571262674 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -80,9 +80,9 @@ create_dotlock( const char *file_to_lock ) DOTLOCK h; int fd = -1; char pidstr[16]; - #if !defined (HAVE_DOSISH_SYSTEM) +#if !defined (HAVE_DOSISH_SYSTEM) struct utsname utsbuf; - #endif +#endif const char *nodename; const char *dirpart; int dirpartlen; @@ -97,9 +97,9 @@ create_dotlock( const char *file_to_lock ) h = m_alloc_clear( sizeof *h ); if( never_lock ) { h->disable = 1; - #ifdef _REENTRANT +#ifdef _REENTRANT /* fixme: aquire mutex on all_lockfiles */ - #endif +#endif h->next = all_lockfiles; all_lockfiles = h; return h; @@ -134,9 +134,9 @@ create_dotlock( const char *file_to_lock ) dirpart = file_to_lock; } - #ifdef _REENTRANT +#ifdef _REENTRANT /* fixme: aquire mutex on all_lockfiles */ - #endif +#endif h->next = all_lockfiles; all_lockfiles = h; @@ -164,9 +164,9 @@ create_dotlock( const char *file_to_lock ) } if( write(fd, pidstr, 11 ) != 11 ) { all_lockfiles = h->next; - #ifdef _REENTRANT +#ifdef _REENTRANT /* release mutex */ - #endif +#endif log_fatal( "error writing to `%s': %s\n", h->tname, strerror(errno) ); close(fd); unlink(h->tname); @@ -176,9 +176,9 @@ create_dotlock( const char *file_to_lock ) } if( close(fd) ) { all_lockfiles = h->next; - #ifdef _REENTRANT +#ifdef _REENTRANT /* release mutex */ - #endif +#endif log_error( "error closing `%s': %s\n", h->tname, strerror(errno)); unlink(h->tname); m_free(h->tname); @@ -186,9 +186,9 @@ create_dotlock( const char *file_to_lock ) return NULL; } - #ifdef _REENTRANT +#ifdef _REENTRANT /* release mutex */ - #endif +#endif #endif h->lockname = m_alloc( strlen(file_to_lock) + 6 ); strcpy(stpcpy(h->lockname, file_to_lock), EXTSEP_S "lock"); @@ -271,10 +271,10 @@ make_dotlock( DOTLOCK h, long timeout ) else if( kill(pid, 0) && errno == ESRCH ) { #ifndef __riscos__ maybe_dead = " - probably dead"; - #if 0 /* we should not do this without checking the permissions */ +#if 0 /* we should not do this without checking the permissions */ /* and the hostname */ log_info( "removing stale lockfile (created by %d)", pid ); - #endif +#endif #else /* __riscos__ */ /* we are *pretty* sure that the other task is dead and therefore we remove the other lock file */ @@ -359,9 +359,9 @@ release_dotlock( DOTLOCK h ) static int read_lockfile( const char *name ) { - #if defined (HAVE_DOSISH_SYSTEM) +#if defined (HAVE_DOSISH_SYSTEM) return 0; - #else +#else int fd, pid; char pidstr[16]; @@ -390,14 +390,14 @@ read_lockfile( const char *name ) return -1; } return pid; - #endif +#endif } void remove_lockfiles() { - #if !defined (HAVE_DOSISH_SYSTEM) +#if !defined (HAVE_DOSISH_SYSTEM) DOTLOCK h, h2; h = all_lockfiles; @@ -415,6 +415,5 @@ remove_lockfiles() m_free(h); h = h2; } - #endif +#endif } - |