History

Revert "stream: don't try to read from all-sparse/no-data files"

The stream layer is just not the right place to make this change since it's also used for completely unrelated purposes such as reading configs. This reverts commit bb7a485c0932375b888a61966970696c06851a15.

sfan5 committed 2 years ago

Commit a33fd3b1 parent 21e167c2 files · +0 −14Browse files

Unified · Split

2 files
  1. meson.build +0 −3
  2. stream/stream_file.c +0 −11
meson.build+0−3
@@ -438,9 +438,6 @@ endif · 437 unmodified lines
438438 features += {'ppoll': cc.has_function('ppoll', args: '-D_GNU_SOURCE',
439439 prefix: '#include <poll.h>')}
440440
441−features += {'seek-data': cc.has_header_symbol('errno.h', 'ENXIO') and
442− cc.has_header_symbol('unistd.h', 'SEEK_DATA', args: '-D_GNU_SOURCE')}
443−
444441 cd_devices = {
445442 'windows': 'D:',
446443 'cygwin': 'D:',
stream/stream_file.c+0−11
@@ -358,17 +358,6 @@ static int open_f(stream_t *stream, const struct stream_open_args *args) · 357 unmodified lines
358358 setmode(p->fd, O_BINARY);
359359 #endif
360360
361−#if HAVE_SEEK_DATA
362− if (stream->mode == STREAM_READ) {
363− off_t first_data = lseek(p->fd, 0, SEEK_DATA);
364− if (first_data == (off_t)-1 && errno == ENXIO) {
365− MP_ERR(stream, "File is empty or all sparse (has no data).\n");
366− s_close(stream);
367− return STREAM_ERROR;
368− }
369− }
370−#endif
371−
372361 off_t len = lseek(p->fd, 0, SEEK_END);
373362 lseek(p->fd, 0, SEEK_SET);
374363 if (len != (off_t)-1) {

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