avserver: check return value of ftruncate()
Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
parent
1fdb5649d9
commit
0de1319ee0
@ -2572,8 +2572,11 @@ static int http_start_receive_data(HTTPContext *c)
|
|||||||
if (c->stream->truncate) {
|
if (c->stream->truncate) {
|
||||||
/* truncate feed file */
|
/* truncate feed file */
|
||||||
ffm_write_write_index(c->feed_fd, FFM_PACKET_SIZE);
|
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);
|
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 {
|
} else {
|
||||||
if ((c->stream->feed_write_index = ffm_read_write_index(fd)) < 0) {
|
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));
|
http_log("Error reading write index from feed file: %s\n", strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user