X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=client_common.c;h=2a6b47d6b2b095daadf05659eafd52abfb218b35;hb=72182df7af74e974af4d85a2f4143ea66a318844;hp=9bcfcb827bb867674f8363f1d114b349c2fc7f76;hpb=ac9cc8f21ddeb821134e657f509bb83cec8c1da4;p=paraslash.git diff --git a/client_common.c b/client_common.c index 9bcfcb82..2a6b47d6 100644 --- a/client_common.c +++ b/client_common.c @@ -255,9 +255,15 @@ static int send_sb_command(struct client_task *ct) return send_sb(ct, 0, command, len, SBD_COMMAND, false); } +/* Find out if the given string is contained in the features vector. */ static bool has_feature(const char *feature, struct client_task *ct) { - return find_arg(feature, ct->features) >= 0? true : false; + if (!ct->features) + return false; + for (int i = 0; ct->features[i]; i++) + if (strcmp(feature, ct->features[i]) == 0) + return i; + return false; } /* @@ -392,12 +398,12 @@ static int client_post_monitor(struct sched *s, void *context) char *buf2; size_t sz; ret = btr_node_status(ct->btrn[1], 0, BTR_NT_LEAF); - if (ret == -E_BTR_EOF) { + if (ret == -E_EOF) { /* empty blob data packet indicates EOF */ PARA_INFO_LOG("blob sent\n"); ret = send_sb(ct, 1, NULL, 0, SBD_BLOB_DATA, true); if (ret >= 0) - ret = -E_BTR_EOF; + ret = -E_EOF; } if (ret < 0) goto close1;