util: Add extra max_size argument to file_lines_load()
[ctdb.git] / tools / ctdb.c
index cb716c591f44888763365446f1a18fba347de6f9..608d50a3000953be14f0846441aa605d224d9a9f 100644 (file)
@@ -858,7 +858,7 @@ static struct pnn_node *read_pnn_node_file(TALLOC_CTX *mem_ctx,
        struct pnn_node *pnn_nodes = NULL;
        struct pnn_node *pnn_node;
 
-       lines = file_lines_load(file, &nlines, mem_ctx);
+       lines = file_lines_load(file, &nlines, 0, mem_ctx);
        if (lines == NULL) {
                return NULL;
        }
@@ -3147,7 +3147,7 @@ static int control_ifaces(struct ctdb_context *ctdb, int argc, const char **argv
 
        for (i=0; i<ifaces->num; i++) {
                if (options.machinereadable){
-                       printm(":%s:%s:%u\n",
+                       printm(":%s:%s:%u:\n",
                               ifaces->ifaces[i].name,
                               ifaces->ifaces[i].link_state?"1":"0",
                               (unsigned int)ifaces->ifaces[i].references);
@@ -4954,6 +4954,11 @@ static int control_setvar(struct ctdb_context *ctdb, int argc, const char **argv
                DEBUG(DEBUG_ERR, ("Unable to set tunable variable '%s'\n", name));
                return -1;
        }
+       if (ret == 1) {
+               DEBUG(DEBUG_WARNING,
+                     ("Setting obsolete tunable variable '%s'\n",
+                      name));
+       }
        return 0;
 }
 
@@ -6505,6 +6510,7 @@ int main(int argc, const char *argv[])
 {
        struct ctdb_context *ctdb;
        char *nodestring = NULL;
+       int machineparsable = 0;
        struct poptOption popt_options[] = {
                POPT_AUTOHELP
                POPT_CTDB_CMDLINE
@@ -6512,6 +6518,7 @@ int main(int argc, const char *argv[])
                { "node",      'n', POPT_ARG_STRING, &nodestring, 0, "node", "integer|all" },
                { "machinereadable", 'Y', POPT_ARG_NONE, &options.machinereadable, 0, "enable machine readable output", NULL },
                { NULL, 'x', POPT_ARG_STRING, &options.machineseparator, 0, "specify separator for machine readable output", "char" },
+               { NULL, 'X', POPT_ARG_NONE, &machineparsable, 0, "enable machine parsable output with separator |", NULL },
                { "verbose",    'v', POPT_ARG_NONE, &options.verbose, 0, "enable verbose output", NULL },
                { "maxruntime", 'T', POPT_ARG_INT, &options.maxruntime, 0, "die if runtime exceeds this limit (in seconds)", "integer" },
                { "print-emptyrecords", 0, POPT_ARG_NONE, &options.printemptyrecords, 0, "print the empty records when dumping databases (catdb, cattdb, dumpdbbackup)", NULL },
@@ -6569,6 +6576,9 @@ int main(int argc, const char *argv[])
                }
        }
 
+       if (machineparsable) {
+               options.machineseparator = "|";
+       }
        if (options.machineseparator != NULL) {
                if (strlen(options.machineseparator) != 1) {
                        printf("Invalid separator \"%s\" - "