]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/misc_cleanups'
authorAndre Noll <maan@systemlinux.org>
Sun, 29 Sep 2013 10:59:04 +0000 (12:59 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 29 Sep 2013 10:59:04 +0000 (12:59 +0200)
Was cooking since 2013-08-04.

3f97ae buffer_tree: Improve documentation of btr_no_parent().
fb9209 Avoid gcc warning on FreeBSD.
778af7 command.c: Avoid declaration after statement.
61c957 extract_v4_addr(): Don't return a structure.
1d7937 command.c: Remove pointless initialization.
c17ede crypt.c: Remove condition which is always true.
a12ecb ipc: Close proc fd.
01d37b Make log functions static.
0ba631 score: Improve documentation of score_update().
d6cf71 GIT-VERSION-GEN: Don't include output of git update-index.

1  2 
buffer_tree.c
command.c

diff --combined buffer_tree.c
index aa9f1cdb0c95b77635981cea0e6bb1588bbcdc03,9ae4d34c9fb6dfd38676e83416a0bcf6d244f25a..b1eeb0363e3741d288656e8c5cea5aa9d186c0ab
@@@ -544,14 -544,16 +544,16 @@@ static bool btr_no_children(struct btr_
  }
  
  /**
-  * Find out whether a node is an orphan node.
+  * Find out whether a node is an orphan.
   *
   * \param btrn The buffer tree node.
   *
   * \return True if \a btrn has no parent.
   *
-  * This function will always return true for the root node.  However in case
-  * nodes have been removed from the tree, other nodes may become orphans too.
+  * This function returns true for the root node and false for any other node.
+  *
+  * After a (non-leaf) node was removed removed from the tree, the function
+  * returns true for all child nodes.
   */
  bool btr_no_parent(struct btr_node *btrn)
  {
@@@ -856,8 -858,6 +858,8 @@@ void btr_splice_out_node(struct btr_nod
                ch->parent = btrn->parent;
                if (btrn->parent)
                        list_move(&ch->node, &btrn->parent->children);
 +              else
 +                      list_del(&ch->node);
        }
        assert(list_empty(&btrn->children));
        btrn->parent = NULL;
diff --combined command.c
index 9f349ee5353c6df5736db1cd2d9c2e115c933248,a50b38449e778f5bae170ed38225afd5243efe46..3d40023f119efc91f446011ae89381790567547f
+++ b/command.c
@@@ -35,8 -35,8 +35,8 @@@
  #include "signal.h"
  #include "version.h"
  
 -struct server_command afs_cmds[] = {DEFINE_AFS_CMD_ARRAY};
 -struct server_command server_cmds[] = {DEFINE_SERVER_CMD_ARRAY};
 +static struct server_command afs_cmds[] = {DEFINE_AFS_CMD_ARRAY};
 +static struct server_command server_cmds[] = {DEFINE_SERVER_CMD_ARRAY};
  
  /** Commands including options must be shorter than this. */
  #define MAX_COMMAND_LEN 32768
@@@ -220,8 -220,8 +220,8 @@@ int send_sb(struct stream_cipher_contex
        int ret;
        struct sb_context *sbc;
        struct iovec iov[2];
-       struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
        sb_transformation trafo = band < SBD_PROCEED? NULL : sc_trafo;
+       struct sb_buffer sbb = SBB_INIT(band, buf, numbytes);
  
        sbc = sb_new_send(&sbb, dont_free, trafo, scc->send);
        do {
@@@ -842,7 -842,7 +842,7 @@@ static int parse_sb_command(struct comm
        if (ret < 0)
                goto out;
        end = iov->iov_base + iov->iov_len;
-       for (i = 0, p = iov->iov_base; p < end; i++)
+       for (i = 0; p < end; i++)
                p += strlen(p) + 1;
        cc->argc = i;
        cc->argv = para_malloc((cc->argc + 1) * sizeof(char *));