commit cleanup: forgot to edit sources and cvs add patch

This commit is contained in:
mchristi 2007-03-20 19:52:42 +00:00
parent 63a3144d8f
commit a7062b594f
2 changed files with 79 additions and 1 deletions

View File

@ -0,0 +1,78 @@
diff -aurp open-iscsi-6.2.0.695/usr/idbm.c open-iscsi-6.2.0.695.work/usr/idbm.c
--- open-iscsi-6.2.0.695/usr/idbm.c 2006-10-03 13:54:51.000000000 -0500
+++ open-iscsi-6.2.0.695.work/usr/idbm.c 2006-10-03 14:44:56.000000000 -0500
@@ -831,10 +831,18 @@ idbm_node_write(idbm_t *db, node_rec_t *
idbm_lock(db);
- snprintf(portal, PATH_MAX, "%s", NODE_CONFIG_DIR);
- if (access(portal, F_OK) != 0) {
+ /* bah: there has to be a function to make all these subdirs for us */
+ if (access(CONFIG_DIR, F_OK) != 0) {
if (mkdir(portal, 0660) != 0) {
- log_error("Could not make %s\n", portal);
+ log_error("Could not make %s %d\n", CONFIG_DIR, errno);
+ rc = errno;
+ goto free_portal;
+ }
+ }
+
+ if (access(NODE_CONFIG_DIR, F_OK) != 0) {
+ if (mkdir(NODE_CONFIG_DIR, 0660) != 0) {
+ log_error("Could not make %s\n", NODE_CONFIG_DIR);
rc = errno;
goto free_portal;
}
@@ -869,6 +877,7 @@ free_portal:
return rc;
}
+/* TODO: merged these two functions */
static int
idbm_discovery_write(idbm_t *db, discovery_rec_t *rec)
{
@@ -883,10 +892,18 @@ idbm_discovery_write(idbm_t *db, discove
}
idbm_lock(db);
- snprintf(portal, PATH_MAX, "%s", ST_CONFIG_DIR);
- if (access(portal, F_OK) != 0) {
- if (mkdir(portal, 0660) != 0) {
- log_error("Could not make %s\n", portal);
+
+ if (access(CONFIG_DIR, F_OK) != 0) {
+ if (mkdir(CONFIG_DIR, 0660) != 0) {
+ log_error("Could not make %s %d\n", CONFIG_DIR, errno);
+ rc = errno;
+ goto free_portal;
+ }
+ }
+
+ if (access(ST_CONFIG_DIR, F_OK) != 0) {
+ if (mkdir(ST_CONFIG_DIR, 0660) != 0) {
+ log_error("Could not make %s\n", ST_CONFIG_DIR);
rc = errno;
goto free_portal;
}
diff -aurp open-iscsi-6.2.0.695/usr/initiator.h open-iscsi-6.2.0.695.work/usr/initiator.h
--- open-iscsi-6.2.0.695/usr/initiator.h 2006-10-03 13:54:51.000000000 -0500
+++ open-iscsi-6.2.0.695.work/usr/initiator.h 2006-10-03 14:08:09.000000000 -0500
@@ -31,11 +31,15 @@
#include "actor.h"
#include "queue.h"
-#define ST_CONFIG_DIR "/etc/iscsi/send_targets"
-#define NODE_CONFIG_DIR "/etc/iscsi/nodes"
+#define CONFIG_DIR "/var/lib/iscsi"
+#define ST_CONFIG_DIR "/var/lib/iscsi/send_targets"
+#define NODE_CONFIG_DIR "/var/lib/iscsi/nodes"
+
#define CONFIG_FILE "/etc/iscsi/iscsid.conf"
-#define PID_FILE "/var/run/iscsid.pid"
#define INITIATOR_NAME_FILE "/etc/iscsi/initiatorname.iscsi"
+
+#define PID_FILE "/var/run/iscsid.pid"
+
#define LOCK_DIR "/var/lock/iscsi"
#define LOCK_FILE "/var/lock/iscsi/lock"
#define LOCK_WRITE_FILE "/var/lock/iscsi/lock.write"

View File

@ -1 +1 @@
01b98ae5349609977c795cc039cd33d3 open-iscsi-6.2.0.695.tar.bz2 2e7ce941ea4e4eda7c82f0b272a33bf9 open-iscsi-2.0-754.tar.gz