From a0013831ff918ac229066c9c804f75e1b50011c5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 5 Dec 2011 21:04:02 +0100 Subject: [PATCH] send: Make ->send_fec() return void. There is only one caller, vss_send(), which ignores the return value. So there is no point in returning an error code from this method. --- dccp_send.c | 3 +-- send.h | 2 +- udp_send.c | 9 ++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dccp_send.c b/dccp_send.c index 53fa54e3..b3bd6263 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -102,13 +102,12 @@ static int dccp_init_fec(struct sender_client *sc) return mps; } -static int dccp_send_fec(struct sender_client *sc, char *buf, size_t len) +static void dccp_send_fec(struct sender_client *sc, char *buf, size_t len) { int ret = write_nonblock(sc->fd, buf, len); if (ret < 0) dccp_shutdown_client(sc); - return ret; } static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds) diff --git a/send.h b/send.h index 836babd5..d9575d3b 100644 --- a/send.h +++ b/send.h @@ -146,7 +146,7 @@ struct fec_client_parms { */ int (*init_fec)(struct sender_client *sc); /** Push out FEC-encoded packets */ - int (*send_fec)(struct sender_client *sc, char *buf, size_t len); + void (*send_fec)(struct sender_client *sc, char *buf, size_t len); }; /** Describes the current status of one paraslash sender. */ diff --git a/udp_send.c b/udp_send.c index d55a9abf..bc238311 100644 --- a/udp_send.c +++ b/udp_send.c @@ -277,14 +277,14 @@ static int udp_check_socket_state(struct sender_client *sc) return -ERRNO_TO_PARA_ERROR(ret); } -static int udp_send_fec(struct sender_client *sc, char *buf, size_t len) +static void udp_send_fec(struct sender_client *sc, char *buf, size_t len) { int ret; if (sender_status == SENDER_OFF) - return 0; + return; if (len == 0) - return 0; + return; ret = udp_check_socket_state(sc); if (ret < 0) goto fail; @@ -298,10 +298,9 @@ static int udp_send_fec(struct sender_client *sc, char *buf, size_t len) } if (ret < 0) goto fail; - return 1; + return; fail: udp_delete_target(sc, para_strerror(-ret)); - return ret; } static int udp_com_add(struct sender_command_data *scd) -- 2.39.2