]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
Fix various dead stores found by the clang static analyzer.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index e1a3c3742a76b66c614e6aaf65f04c7a31277309..066a8851bca7633f04dfb139d4c15ec19f5cdfa1 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -587,7 +587,6 @@ static struct timeval *vss_compute_timeout(struct vss_task *vsst)
 static void vss_eof(struct vss_task *vsst)
 {
 
-       mmd->stream_start = *now;
        if (!vsst->map)
                return;
        if (mmd->new_vss_status_flags & VSS_NOMORE)
@@ -642,10 +641,7 @@ static int need_to_request_new_audio_file(struct vss_task *vsst)
 }
 
 /**
- * Compute the timeout for para_server's main select-loop.
- *
- * This function gets called from para_server to determine the timeout value
- * for its main select loop.
+ * Compute the timeout for the main select-loop of the scheduler.
  *
  * \param s Pointer to the server scheduler.
  * \param t Pointer to the vss task structure.
@@ -671,6 +667,8 @@ static void vss_pre_select(struct sched *s, struct task *t)
                                senders[i].shutdown_clients();
                list_for_each_entry_safe(fc, tmp, &fec_client_list, node)
                        fc->first_stream_chunk = -1;
+               mmd->stream_start.tv_sec = 0;
+               mmd->stream_start.tv_usec = 0;
        }
        if (vss_next())
                vss_eof(vsst);
@@ -879,7 +877,10 @@ static void vss_post_select(struct sched *s, struct task *t)
        } else if (FD_ISSET(vsst->afs_socket, &s->wfds)) {
                PARA_NOTICE_LOG("requesting new fd from afs\n");
                ret = send_buffer(vsst->afs_socket, "new");
-               vsst->afsss = AFS_SOCKET_AFD_PENDING;
+               if (ret < 0)
+                       PARA_CRIT_LOG("%s\n", para_strerror(-ret));
+               else
+                       vsst->afsss = AFS_SOCKET_AFD_PENDING;
        }
        for (i = 0; senders[i].name; i++) {
                if (!senders[i].post_select)