Unified · Split
| @@ -2572,8 +2572,11 @@ static int http_start_receive_data(HTTPContext *c) · 2571 unmodified lines | ||
| 2572 | 2572 | if (c->stream->truncate) { |
| 2573 | 2573 | /* truncate feed file */ |
| 2574 | 2574 | ffm_write_write_index(c->feed_fd, FFM_PACKET_SIZE); |
| 2575 | − ftruncate(c->feed_fd, FFM_PACKET_SIZE); | |
| 2576 | 2575 | http_log("Truncating feed file '%s'\n", c->stream->feed_filename); |
| 2576 | + if (ftruncate(c->feed_fd, FFM_PACKET_SIZE) < 0) { | |
| 2577 | + http_log("Error truncating feed file: %s\n", strerror(errno)); | |
| 2578 | + return -1; | |
| 2579 | + } | |
| 2577 | 2580 | } else { |
| 2578 | 2581 | if ((c->stream->feed_write_index = ffm_read_write_index(fd)) < 0) { |
| 2579 | 2582 | http_log("Error reading write index from feed file: %s\n", strerror(errno)); |