]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
- ignore blank lines at end of lists
authorAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 06:23:47 +0000 (16:23 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 29 May 2007 06:23:47 +0000 (16:23 +1000)
- rpm tweaks
(This used to be ctdb commit 3506464fa914c5aad10fe22283563d021ca45ca0)

ctdb/common/ctdb.c
ctdb/packaging/RHEL/ctdb.spec
ctdb/takeover/ctdb_takeover.c

index 1a2bacd0096ccf008f85766d7a780979f287c4c0..b7949f75e52531207d60eaf7805f6ead6445e263 100644 (file)
@@ -151,6 +151,9 @@ int ctdb_set_nlist(struct ctdb_context *ctdb, const char *nlist)
                ctdb_set_error(ctdb, "Failed to load nlist '%s'\n", nlist);
                return -1;
        }
+       while (nlines > 0 && strcmp(lines[nlines-1], "") == 0) {
+               nlines--;
+       }
 
        for (i=0;i<nlines;i++) {
                if (ctdb_add_node(ctdb, lines[i]) != 0) {
index 78baec4a6f14da2a4b0d5be23c39efeef7ddb1f0..da61f5a4b34464a10f09d429943cc37a39610171 100644 (file)
@@ -43,6 +43,8 @@ CC="gcc"
 
 CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./configure \
        --prefix=%{_prefix} \
+       --sysconfdir=%{_sysconfdir} \
+       --localstatedir="/var"
 
 make showflags
 make   
index a9a01d75e1bf1803a00c5bb5de7ca722e3eec7f1..5e4368c80c025c5f2f185964affcd259191e94a0 100644 (file)
@@ -237,6 +237,9 @@ int ctdb_set_public_addresses(struct ctdb_context *ctdb, const char *alist)
                ctdb_set_error(ctdb, "Failed to load public address list '%s'\n", alist);
                return -1;
        }
+       while (nlines > 0 && strcmp(lines[nlines-1], "") == 0) {
+               nlines--;
+       }
 
        if (nlines != ctdb->num_nodes) {
                DEBUG(0,("Number of lines in %s does not match number of nodes!\n", alist));