aboutsummaryrefslogtreecommitdiffstats
path: root/avserver.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-04-21 17:01:35 +0100
committerMans Rullgard <mans@mansr.com>2012-05-06 12:04:23 +0100
commit0de1319ee0109facefe9804ffe0f0d0df36b27ad (patch)
tree2251355823942ceb0c4ed2fae4463b9c7b04b36f /avserver.c
parent1fdb5649d934df19237d5f53c10ae1fff5934e2a (diff)
downloadffmpeg-0de1319ee0109facefe9804ffe0f0d0df36b27ad.tar.gz
avserver: check return value of ftruncate()
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'avserver.c')
-rw-r--r--avserver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/avserver.c b/avserver.c
index 2b16932ab1..5777a08cd3 100644
--- a/avserver.c
+++ b/avserver.c
@@ -2572,8 +2572,11 @@ static int http_start_receive_data(HTTPContext *c)
if (c->stream->truncate) {
/* truncate feed file */
ffm_write_write_index(c->feed_fd, FFM_PACKET_SIZE);
- ftruncate(c->feed_fd, FFM_PACKET_SIZE);
http_log("Truncating feed file '%s'\n", c->stream->feed_filename);
+ if (ftruncate(c->feed_fd, FFM_PACKET_SIZE) < 0) {
+ http_log("Error truncating feed file: %s\n", strerror(errno));
+ return -1;
+ }
} else {
if ((c->stream->feed_write_index = ffm_read_write_index(fd)) < 0) {
http_log("Error reading write index from feed file: %s\n", strerror(errno));