Mercurial > octave
diff liboctave/util/kpse.cc @ 21910:4d723ba06b4a
provide wrappers for some unistd.h functions
* liboctave/wrappers/unistd-wrappers.c,
liboctave/wrappers/unistd-wrappers.h: New files.
* liboctave/wrappers/module.mk: Update.
* gl2ps-print.cc, oct-hist.cc, oct-procbuf.cc, oct-tex-lexer.in.ll,
sysdep.cc, octave.cc, parse-tree/lex.ll, file-ops.cc, lo-sysdep.cc,
oct-env.cc, oct-syscalls.cc, cmd-edit.cc, kpse.cc:
Use wrappers instead of calling unistd.h functions directly.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 14 Jun 2016 18:10:04 -0400 |
parents | 525b46f1d48f |
children | 24215a16f3b2 |
line wrap: on
line diff
--- a/liboctave/util/kpse.cc Tue Jun 14 16:31:34 2016 -0400 +++ b/liboctave/util/kpse.cc Tue Jun 14 18:10:04 2016 -0400 @@ -40,9 +40,6 @@ #include <iostream> #include <string> -#include <sys/types.h> -#include <unistd.h> - // Needed for NAME_MAX. #include <dirent.h> @@ -52,6 +49,7 @@ #include "oct-env.h" #include "oct-passwd.h" #include "pathsearch.h" +#include "unistd-wrappers.h" #if defined (__WIN32__) && ! defined (__CYGWIN__) # define WIN32_LEAN_AND_MEAN 1 @@ -203,7 +201,7 @@ const char *t = fn.c_str (); - if (access (t, R_OK) == 0) + if (octave_access_wrapper (t, octave_access_r_ok ()) == 0) { octave::sys::file_stat fs (fn);