X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/93a18dd7a6b92922361383a4e6152380da5f3583..4fb142af4ad2ca73d141cc04af24e7c1b62f8a77:/sbr/lock_file.c diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 19cad331..b1f31b68 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -314,7 +314,7 @@ lkopen (const char *file, int access, mode_t mode, enum locktype ltype, #endif /* HAVE_FLOCK */ default: - adios(NULL, "Internal locking error: unsupported lock type used!"); + die("Internal locking error: unsupported lock type used!"); } return -1; @@ -522,6 +522,7 @@ lkopen_dot (const char *file, int access, mode_t mode, int *failed_to_lock) lockname (file, &lkinfo, 1); } + close(fd); *failed_to_lock = 1; return -1; } @@ -575,7 +576,7 @@ lockit (struct lockinfo *li) fd = link(tmpfile, curlock); (void) m_unlink(tmpfile); - return (fd == -1 ? -1 : 0); + return fd == -1 ? -1 : 0; } #endif /* HAVE_LIBLOCKFILE */ @@ -749,20 +750,20 @@ init_locktype(const char *lockname) #ifdef HAVE_LOCKF return LOCKF_LOCKING; #else /* ! HAVE_LOCKF */ - adios(NULL, "lockf not supported on this system"); + die("lockf not supported on this system"); #endif /* HAVE_LOCKF */ } if (strcasecmp(lockname, "flock") == 0) { #ifdef HAVE_FLOCK return FLOCK_LOCKING; #else /* ! HAVE_FLOCK */ - adios(NULL, "flock not supported on this system"); + die("flock not supported on this system"); #endif /* HAVE_FLOCK */ } if (strcasecmp(lockname, "dot") == 0) { return DOT_LOCKING; } - adios(NULL, "Unknown lock type: \"%s\"", lockname); + die("Unknown lock type: \"%s\"", lockname); /* NOTREACHED */ return 0; }