[Initng-svn] r4413 - initng/trunk/plugins/reload

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Jun 8 14:04:20 CEST 2006


Author: jimmy
Date: Thu Jun  8 14:04:18 2006
New Revision: 4413

Modified:
   initng/trunk/plugins/reload/initng_reload.c
   initng/trunk/plugins/reload/initng_reload.h

Log:
Reload did not save vn, how coud i missed this?


Modified: initng/trunk/plugins/reload/initng_reload.c
==============================================================================
--- initng/trunk/plugins/reload/initng_reload.c	(original)
+++ initng/trunk/plugins/reload/initng_reload.c	Thu Jun  8 14:04:18 2006
@@ -44,8 +44,8 @@
 
 INITNG_PLUGIN_MACRO;
 
-#define SAVE_FILE      VARDIR "/initng_db_backup.v13"
-#define SAVE_FILE_FAKE VARDIR "/initng_db_backup_fake.v13"
+#define SAVE_FILE      VARDIR "/initng_db_backup.v14"
+#define SAVE_FILE_FAKE VARDIR "/initng_db_backup_fake.v14"
 
 static int write_file(const char *filename);
 static int read_file(const char *filename);
@@ -263,6 +263,8 @@
 					i++;
 					continue;
 				}
+				
+				/* copy data */
 				switch (d->type->opt_type)
 				{
 					case STRING:
@@ -278,6 +280,11 @@
 					default:
 						break;
 				}
+				
+				/* copy variable name if present */
+				if(d->type->opt_type > 50)
+					d->vn = i_strdup(entry.data[i].vn);
+					
 				list_add(&d->list, &new_entry->data.head.list);
 				i++;
 			}
@@ -413,6 +420,12 @@
 				default:
 					break;
 			}
+			
+			/* if they have variable names */
+			if(c_d->type->opt_type > 50)
+			{
+				strncpy(entry.data[i].vn, c_d->vn, MAX_DATA_VN_LEN);
+			}
 
 			/* save in next data entry row */
 			i++;

Modified: initng/trunk/plugins/reload/initng_reload.h
==============================================================================
--- initng/trunk/plugins/reload/initng_reload.h	(original)
+++ initng/trunk/plugins/reload/initng_reload.h	Thu Jun  8 14:04:18 2006
@@ -29,11 +29,13 @@
 #define MAX_PROCESSES 6
 #define MAX_PTYPE_STRING_LEN 100
 #define MAX_ENTRYS_FOR_SERVICE 20
+#define MAX_DATA_VN_LEN 100
 
 typedef struct
 {
 	char type[MAX_TYPE_STRING_LEN + 1];
 	e_dt opt_type;
+	char vn[MAX_DATA_VN_LEN + 1];
 	union
 	{
 		char s[MAX_DATA_STRING_LEN + 1];


More information about the Initng-svn mailing list