1 diff -ur bluemote.orig/bluemote.c bluemote/bluemote.c
2 --- bluemote.orig/bluemote.c 2005-01-03 08:15:42.000000000 +0100
3 +++ bluemote/bluemote.c 2006-06-08 00:04:50.000000000 +0200
14 - printf("Another instance of Bluemote already running!\n");
17 + printf("Another instance of Bluemote already running!\n");
21 - if(!open_consumer())
23 - printf("Unable to listen for messages!\n");
26 + if(!open_consumer())
28 + printf("Unable to listen for messages!\n");
32 strcpy(logfile, getenv("HOME"));
33 diff -ur bluemote.orig/ipc.c bluemote/ipc.c
34 --- bluemote.orig/ipc.c 2004-12-09 10:30:08.000000000 +0100
35 +++ bluemote/ipc.c 2006-06-08 00:05:22.000000000 +0200
37 struct sockaddr_un sockadr;
49 strcpy(lockfile, getenv("HOME"));
50 strcat(lockfile, BLUEMOTEDIR);
51 strcat(lockfile, LOCKFILE);
53 - fl.l_type = F_WRLCK;
54 - fl.l_whence = SEEK_SET;
58 - if((fdlock = open(lockfile, O_WRONLY|O_CREAT, 0600)) == -1)
59 + if((fdlock = open(lockfile, O_WRONLY|O_CREAT|O_EXCL, 0600)) == -1)
62 - if(fcntl(fdlock, F_SETLK, &fl) == -1)
64 + atexit(remove_lock);