Blob Blame Raw
diff -up open-iscsi-2.0-870-rc1/usr/idbm.c~ open-iscsi-2.0-870-rc1/usr/idbm.c
--- open-iscsi-2.0-870-rc1/usr/idbm.c~	2008-09-29 13:01:48.000000000 +0200
+++ open-iscsi-2.0-870-rc1/usr/idbm.c	2008-09-29 13:01:48.000000000 +0200
@@ -849,6 +849,14 @@ int idbm_lock(void)
 		ret = link(LOCK_FILE, LOCK_WRITE_FILE);
 		if (ret == 0)
 			break;
+
+		if (errno != EEXIST) {
+			log_error("Could not lock discovery DB: %s: %s",
+					LOCK_WRITE_FILE, strerror(errno));
+			log_error("Maybe you are not root?");
+			exit(-1);
+		} else if (i == 0) 
+			log_warning("Waiting for discovery DB lock");
 
 		usleep(10000);
 	}