History

avserver: check return value of ftruncate()

Mans Rullgard committed 14 years ago

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

Unified · Split

avserver.c+4−1
@@ -2572,8 +2572,11 @@ static int http_start_receive_data(HTTPContext *c) · 2571 unmodified lines
25722572 if (c->stream->truncate) {
25732573 /* truncate feed file */
25742574 ffm_write_write_index(c->feed_fd, FFM_PACKET_SIZE);
2575− ftruncate(c->feed_fd, FFM_PACKET_SIZE);
25762575 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+ }
25772580 } else {
25782581 if ((c->stream->feed_write_index = ffm_read_write_index(fd)) < 0) {
25792582 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