X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f5d307951949b2787173fd2dc0aa413b59a9486e..a40781a8549f7f16a36b382bafa0c19333da13e9:/sbr/lock_file.c diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 987b922c..01d7ae49 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -24,19 +24,13 @@ # include #endif #include -#include #include #ifdef HAVE_FLOCK # include #endif -#ifdef HAVE_LOCKF -# include -#endif - -#include #if defined(HAVE_LIBLOCKFILE) -#include +# include #endif #ifdef LOCKDIR @@ -386,6 +380,7 @@ lkopen_fcntl(const char *file, int access, mode_t mode) } +#ifdef HAVE_FLOCK /* * Open and lock a file, using flock locking */ @@ -418,7 +413,7 @@ lkopen_flock(const char *file, int access, mode_t mode) errno = saved_errno; return -1; } - +#endif /* HAVE_FLOCK */ /* * Open and lock a file, using lockf locking @@ -745,21 +740,21 @@ alrmser (int sig) static enum locktype init_locktype(const char *lockname) { - if (mh_strcasecmp(lockname, "fcntl") == 0) { + if (strcasecmp(lockname, "fcntl") == 0) { return FCNTL_LOCKING; - } else if (mh_strcasecmp(lockname, "lockf") == 0) { + } else if (strcasecmp(lockname, "lockf") == 0) { #ifdef HAVE_LOCKF return LOCKF_LOCKING; #else /* ! HAVE_LOCKF */ adios(NULL, "lockf not supported on this system"); #endif /* HAVE_LOCKF */ - } else if (mh_strcasecmp(lockname, "flock") == 0) { + } else if (strcasecmp(lockname, "flock") == 0) { #ifdef HAVE_FLOCK return FLOCK_LOCKING; #else /* ! HAVE_FLOCK */ adios(NULL, "flock not supported on this system"); #endif /* HAVE_FLOCK */ - } else if (mh_strcasecmp(lockname, "dot") == 0) { + } else if (strcasecmp(lockname, "dot") == 0) { return DOT_LOCKING; } else { adios(NULL, "Unknown lock type: \"%s\"", lockname);