X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=client_common.c;h=642852ec6b8751454538ac9f3a021970f5cfbdef;hb=a25f6bb7169f0ea86522a0c613a8ec1dad358103;hp=64f6c67612a5c665b87dcdb8d3e051bc7500b455;hpb=a0707daa23f8706326aa837f969c20d3e4ee02aa;p=paraslash.git diff --git a/client_common.c b/client_common.c index 64f6c676..642852ec 100644 --- a/client_common.c +++ b/client_common.c @@ -398,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; @@ -490,7 +490,7 @@ int client_connect(struct client_task *ct, struct sched *s, PARA_NOTICE_LOG("connecting %s:%u\n", host, port); ct->scc.fd = -1; - ret = para_connect_simple(IPPROTO_TCP, host, port); + ret = para_connect(IPPROTO_TCP, host, port); if (ret < 0) return ret; ct->scc.fd = ret; @@ -578,8 +578,9 @@ int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr, if (CLIENT_OPT_GIVEN(KEY_FILE, lpr)) kf = para_strdup(CLIENT_OPT_STRING_VAL(KEY_FILE, lpr)); else { + struct stat statbuf; kf = make_message("%s/.paraslash/key.%s", home, user); - if (!file_exists(kf)) { + if (stat(kf, &statbuf) != 0) { /* assume file does not exist */ free(kf); kf = make_message("%s/.ssh/id_rsa", home); }