Skip to content

Commit

Permalink
Check source file exists earlier
Browse files Browse the repository at this point in the history
Fixes #9
Signed-off-by: Roi Dayan <roi.dayan@gmail.com>
  • Loading branch information
roidayan committed Jul 2, 2019
1 parent 576073d commit 0021f37
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rdcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,16 @@ static int rdcp_run_client(struct rdcp_cb *cb)
struct ibv_recv_wr *bad_wr;
int i, ret;

if (!cb->use_null) {
int fd = open(cb->metadata.src_path, O_RDONLY);

close(fd);
if (fd < 0) {
perror("failed to open source file");
return errno;
}
}

ret = rdcp_bind_client(cb);
if (ret)
return ret;
Expand Down

0 comments on commit 0021f37

Please sign in to comment.