History

avserver: check return value of ftruncate()

Mans Rullgard committed 14 years ago

Commit 0de13191 parent 1fdb5641 file · +4 −1Browse files

Showing the changes to avserver.c (1 of 1 file). Show all

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t