summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/file.c b/main/file.c
index 4c1414867..2f6cb3140 100644
--- a/main/file.c
+++ b/main/file.c
@@ -961,10 +961,12 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
* done this way because there is no where for ast_openstream_full to
* return the file had no data. */
seekattempt = fseek(fs->f, -1, SEEK_END);
- if (!seekattempt)
- ast_seekstream(fs, 0, SEEK_SET);
- else
+ if (seekattempt && errno == EINVAL) {
+ /* Zero-length file, as opposed to a pipe */
return 0;
+ } else {
+ ast_seekstream(fs, 0, SEEK_SET);
+ }
vfs = ast_openvstream(chan, filename, preflang);
if (vfs) {