Mercurial > hg > octave-terminal
changeset 12941:9a498efac5f1 stable
use gnulib::fseek and gnulib::fopen
* file-io.cc (do_stream_open): Use gnulib::fopen instead of fopen.
* input.cc (get_input_from_file): Likewise.
* c-file-ptr-stream.h (c_file_ptr_buf::seek):
Use gnulib::fseek instead of fseek.
* bootstrap.conf (gnulib_modules):
Include fopen, fflush, fseek, and ftell in the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 09 Aug 2011 22:16:06 -0400 |
parents | 70e9ffbc4c76 |
children | 1be5f06d9fa7 0c74237b3479 |
files | build-aux/bootstrap.conf src/c-file-ptr-stream.cc src/file-io.cc src/input.cc |
diffstat | 4 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/build-aux/bootstrap.conf +++ b/build-aux/bootstrap.conf @@ -25,6 +25,10 @@ fcntl filemode fnmatch + fopen + fflush + fseek + ftell getcwd gethostname getopt-gnu
--- a/src/c-file-ptr-stream.cc +++ b/src/c-file-ptr-stream.cc @@ -195,9 +195,7 @@ int c_file_ptr_buf::seek (long offset, int origin) { - // gnulib::fseek doesn't seem to work, so don't use it until problem - // can be properly diagnosed and fixed. - return f ? fseek (f, offset, origin) : -1; + return f ? gnulib::fseek (f, offset, origin) : -1; } long
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -494,7 +494,7 @@ { tmode.erase (pos, 1); - FILE *fptr = ::fopen (fname.c_str (), tmode.c_str ()); + FILE *fptr = gnulib::fopen (fname.c_str (), tmode.c_str ()); int fd = fileno (fptr); @@ -509,7 +509,7 @@ else #endif { - FILE *fptr = ::fopen (fname.c_str (), tmode.c_str ()); + FILE *fptr = gnulib::fopen (fname.c_str (), tmode.c_str ()); retval = octave_stdiostream::create (fname, fptr, md, flt_fmt);