]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
send: Make ->send_fec() return void.
authorAndre Noll <maan@systemlinux.org>
Mon, 5 Dec 2011 20:04:02 +0000 (21:04 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 18 Dec 2011 16:23:42 +0000 (17:23 +0100)
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
send.h
udp_send.c

index 53fa54e3fbac6fca71ea6005c10a6fa2e707dd3f..b3bd6263ab39acdddee033053c92f2432e801123 100644 (file)
@@ -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 836babd50845088be08a2061fe39cc6ffd7760cb..d9575d3bfc816237cc85302aa0dcc55ecbec05e4 100644 (file)
--- 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. */
index d55a9abf3e43355118f77d9c158311d730effcf9..bc23831147d957c548fcfece7b97e3f13f20c7a6 100644 (file)
@@ -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)