Skip to content

Commit c234c2a

Browse files
authored
Merge pull request #5673 from larsewi/connect
CFE-4414: `cf-net connect` now exits with 1 in case of error
2 parents 06114f8 + 69d25d3 commit c234c2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cf-net/cf-net.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ static int CFNetRun(CFNetOptions *opts, char **args, char *hostnames)
472472
int ret = 0;
473473
char *hostname = strtok(hosts, ",");
474474
while (hostname != NULL){
475-
CFNetCommandSwitch(opts, hostname, args, cmd);
475+
if (CFNetCommandSwitch(opts, hostname, args, cmd) != 0) {
476+
ret = -1;
477+
}
476478
hostname = strtok(NULL, ",");
477479
}
478480
free(hosts);
@@ -636,8 +638,7 @@ static int CFNetConnect(const char *hostname, const char *use_protocol_version,
636638
Log(LOG_LEVEL_ERR, "No hostname specified");
637639
return -1;
638640
}
639-
CFNetConnectSingle(hostname, use_protocol_version, true);
640-
return 0;
641+
return CFNetConnectSingle(hostname, use_protocol_version, true);
641642
}
642643

643644
static void CFNetDisconnect(AgentConnection *conn)

0 commit comments

Comments
 (0)