diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-01-10 00:32:50 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-01-10 00:32:50 +0000 |
commit | e2ccb51b48c3f9e66da52a2554d1ea18f71c43ba (patch) | |
tree | dbc5284025e5e1388a1d510417d4e3e8c6a3756b /src/lock.c | |
parent | 2104b80446dfd4bbc26d0d75691de4b4603a30f5 (diff) |
Make it an autoconf pacakage
git-svn-id: file:///home/lennart/svn/public/ivam2/trunk@25 dbf6933d-3bce-0310-9bcc-ed052ba35b35
Diffstat (limited to 'src/lock.c')
-rw-r--r-- | src/lock.c | 33 |
1 files changed, 27 insertions, 6 deletions
@@ -1,3 +1,27 @@ +/* $Id$ */ + +/*** + This file is part of ivam2. + + ivam2 is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + ivam2 is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with ivam2; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +***/ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + #include <unistd.h> #include <sys/stat.h> #include <stdio.h> @@ -16,12 +40,9 @@ #include "util.h" #include "main.h" -/* Where do lockfiles reside? */ -#define LOCK_PATH "/var/lock" - static const char *lockfile(const char *dev) { static char lockfile[PATH_MAX]; - snprintf(lockfile, sizeof(lockfile), "%s/LCK..%s", LOCK_PATH, basename((char*) dev)); + snprintf(lockfile, sizeof(lockfile), "%s/LCK..%s", LOCKDIR, basename((char*) dev)); return lockfile; } @@ -38,8 +59,8 @@ int device_lock(const char *dev) { char buf[100]; char uidbuf[32]; - if (stat(LOCK_PATH, &st) != 0 || !S_ISDIR(st.st_mode)) { - daemon_log(LOG_ERR, "Failed to lock device, directory "LOCK_PATH" not existent."); + if (stat(LOCKDIR, &st) != 0 || !S_ISDIR(st.st_mode)) { + daemon_log(LOG_ERR, "Failed to lock device, directory "LOCKDIR" not existent."); return -1; } |