Make global lockfile actually work
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1485 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -60,10 +60,12 @@ otp_db_open (void) | |||||||
|       close(lock); |       close(lock); | ||||||
|       break; |       break; | ||||||
|     } |     } | ||||||
|     if (time(NULL) - statbuf.st_mtime > OTP_DB_TIMEOUT) |     if (stat (OTP_DB_LOCK, &statbuf) == 0) { | ||||||
|       unlink (OTP_DB_LOCK); |       if (time(NULL) - statbuf.st_mtime > OTP_DB_TIMEOUT) | ||||||
|     else | 	unlink (OTP_DB_LOCK); | ||||||
|       sleep (1); |       else | ||||||
|  | 	sleep (1); | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|   if (i == RETRIES) |   if (i == RETRIES) | ||||||
|     return NULL; |     return NULL; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund