Index: trunk/ippTools/src/magictool.c
===================================================================
--- trunk/ippTools/src/magictool.c	(revision 23660)
+++ trunk/ippTools/src/magictool.c	(revision 23688)
@@ -535,9 +535,9 @@
 
     // default values
-    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
-
-    if (code > 0) {
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
+
+    if (fault > 0) {
         char *query = "UPDATE magicRun SET fault = %d, state = 'full' WHERE magic_id = %" PRId64;
-        if (!p_psDBRunQueryF(config->dbh, query, code, magic_id)) {
+        if (!p_psDBRunQueryF(config->dbh, query, fault, magic_id)) {
             psError(PS_ERR_UNKNOWN, false,
                     "failed to set fault for magic_id %" PRId64, magic_id);
@@ -561,5 +561,5 @@
     psMetadata *where = psMetadataAlloc();
     PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "==");
-    PXOPT_COPY_S16(config->args, where, "-code", "fault", "==");
+    PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
 
     psString query = psStringCopy("UPDATE magicRun SET fault = 0, state = 'run' WHERE fault != 0");
@@ -908,5 +908,5 @@
 
     // default values
-    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
 
     if (!magicNodeResultInsert(config->dbh,
@@ -914,5 +914,5 @@
                                node,
                                uri,
-                               code
+                               fault
         )) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -931,5 +931,5 @@
     PXOPT_COPY_STR(config->args, where, "-node", "node", "==");
     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
-    PXOPT_COPY_S16(config->args, where, "-code", "magicNodeResult.fault", "==");
+    PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
 
     psString query = pxDataGet("magictool_revertnode.sql");
@@ -1037,5 +1037,5 @@
 
     // default values
-    PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
+    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
 
     if (!psDBTransaction(config->dbh)) {
@@ -1048,5 +1048,5 @@
                          uri,
                          streaks,
-                         code
+                         fault
         )) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -1094,5 +1094,5 @@
     psMetadata *where = psMetadataAlloc();
     PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "==");
-    PXOPT_COPY_S16(config->args, where, "-code", "fault", "==");
+    PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
 
     if (!psDBTransaction(config->dbh)) {
