summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-02-06 01:04:28 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:26 -0700
commitd2cf99df7df132d8d90c4f7b438374618793c15a (patch)
treefae944f5a91a1d099cdbf7b30a3146caa2119c00 /udevd.c
parentaca29aa51f0c8dfb1e6b8d60471d4034b65effb5 (diff)
[PATCH] udevd - kill the lockfile
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/udevd.c b/udevd.c
index 10d67f2c35..3ce8c8b07d 100644
--- a/udevd.c
+++ b/udevd.c
@@ -21,7 +21,6 @@
#include <pthread.h>
#include <stddef.h>
-#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include <unistd.h>
@@ -30,7 +29,6 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
@@ -324,7 +322,6 @@ static void sig_handler(int signum)
switch (signum) {
case SIGINT:
case SIGTERM:
- unlink(UDEVD_LOCK);
exit(20 + signum);
break;
default:
@@ -332,28 +329,6 @@ static void sig_handler(int signum)
}
}
-static int one_and_only(void)
-{
- char string[50];
- int lock_file;
-
- lock_file = open(UDEVD_LOCK, O_RDWR | O_CREAT, 0x640);
- if (lock_file < 0)
- return -1;
-
- /* see if we can lock */
- if (lockf(lock_file, F_TLOCK, 0) < 0) {
- dbg("file is already locked, exit");
- close(lock_file);
- return -1;
- }
-
- snprintf(string, sizeof(string), "%d\n", getpid());
- write(lock_file, string, strlen(string));
-
- return 0;
-}
-
int main(int argc, char *argv[])
{
int ssock;
@@ -369,10 +344,6 @@ int main(int argc, char *argv[])
init_logging("udevd");
- /* only let one version of the daemon run at any one time */
- if (one_and_only() != 0)
- exit(0);
-
signal(SIGINT, sig_handler);
signal(SIGTERM, sig_handler);