[pisa-src] r1154 - trunk/pairing/management.c

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 15 Oct 2009 12:05:44 +0200

Author: biurrun
Date: Thu Oct 15 12:05:44 2009
New Revision: 1154

Log:
Revert commit r1147, it fails to compile.

Modified:
   trunk/pairing/management.c

Modified: trunk/pairing/management.c
==============================================================================
--- trunk/pairing/management.c  Thu Oct 15 11:53:29 2009        (r1153)
+++ trunk/pairing/management.c  Thu Oct 15 12:05:44 2009        (r1154)
@@ -342,35 +342,6 @@
     return ul;
 }
 
-/* Tries to create a lock file to let only one instance of the program run
- * @return 0 -> An instance is running
- * @return 1 -> Lock file was created successfully
- */
-static int get_lock(void)
-{
-       int fdlock;
-       struct flock fl;
-
-       fl.l_type = F_WRLCK;
-       fl.l_whence = SEEK_SET;
-       fl.l_start = 0;
-       fl.l_len = 1;
-
-       if((fdlock = open("pisamgmt.lock", O_WRONLY|O_CREAT, 666)) == -1)
-       {
-               return 0;
-       }
-
-       if(fcntl(fdlock, F_SETLK, &fl) == -1)
-       {
-               return 0;
-       }
-
-       return 1;
-
-
-}
-
 /** Main program that will be run on the user's computer.
  */
 int main(int argc, char *argv[])
@@ -386,12 +357,6 @@
     pisa_userhitlist_entry *uhlentry = NULL;
     pisa_userhitlist_entry new_entry = {};
 
-    if(!get_lock())
-    {
-       PISA_ERROR("A management instance is already running!");
-       return ERROR_ALREADY_RUNNING;
-    }
-
     pisa_mgmt_conf_init(&managementconf);
 
     new_entry.active = NO_CHANGE;

Other related posts:

  • » [pisa-src] r1154 - trunk/pairing/management.c - Diego Biurrun