From: Andre Noll Date: Sun, 29 Sep 2013 10:59:04 +0000 (+0200) Subject: Merge branch 't/misc_cleanups' X-Git-Tag: v0.5.1~12 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=74145aabe851ba5b7eff47b650f401f49b5c740d;hp=-c Merge branch 't/misc_cleanups' 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. --- 74145aabe851ba5b7eff47b650f401f49b5c740d diff --combined buffer_tree.c index aa9f1cdb,9ae4d34c..b1eeb036 --- a/buffer_tree.c +++ b/buffer_tree.c @@@ -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 9f349ee5,a50b3844..3d40023f --- a/command.c +++ 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 *));