aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk/ASTERISK-18994.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/asterisk/ASTERISK-18994.patch')
-rw-r--r--main/asterisk/ASTERISK-18994.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/main/asterisk/ASTERISK-18994.patch b/main/asterisk/ASTERISK-18994.patch
new file mode 100644
index 0000000000..702e91375d
--- /dev/null
+++ b/main/asterisk/ASTERISK-18994.patch
@@ -0,0 +1,28 @@
+--- a/main/file.c.orig 2011-12-09 11:32:05.000000000 +0200
++++ b/main/file.c 2011-12-09 11:35:22.000000000 +0200
+@@ -1005,6 +1005,7 @@
+ struct ast_filestream *fs;
+ struct ast_filestream *vfs=NULL;
+ char fmt[256];
++ off_t pos;
+ int seekattempt;
+ int res;
+
+@@ -1017,12 +1018,14 @@
+ /* check to see if there is any data present (not a zero length file),
+ * 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);
++ pos = ftello(fs->f);
++ seekattempt = fseeko(fs->f, -1, SEEK_END);
+ if (seekattempt && errno == EINVAL) {
+ /* Zero-length file, as opposed to a pipe */
+ return 0;
+- } else {
+- ast_seekstream(fs, 0, SEEK_SET);
++ }
++ if (seekattempt == 0) {
++ fseeko(fs->f, pos, SEEK_SET);
+ }
+
+ vfs = ast_openvstream(chan, filename, preflang);