# HG changeset patch # User John W. Eaton # Date 1264058753 18000 # Node ID 2b1f3f156aaf8b7188544e9fc874984311a751f4 # Parent 96ed9db3345c40b11327b9fc074a99e45910f115 provide wrapper for umask diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2010-01-21 John W. Eaton + + * lo-cutils.c (octave_umask): New funtion. + * lo-utils.h: Provide decl. + * file-ops.cc (file_ops::umask): Call octave_umask. + 2010-01-21 John W. Eaton * file-ops.h (file_ops::mkdir): Move definitions to file-ops.cc. diff --git a/liboctave/file-ops.cc b/liboctave/file-ops.cc --- a/liboctave/file-ops.cc +++ b/liboctave/file-ops.cc @@ -816,11 +816,7 @@ int file_ops::umask (mode_t mode) { -#if defined (HAVE_UMASK) - return ::umask (mode); -#else - return 0; -#endif + return octave_umask (mode); } int diff --git a/liboctave/lo-cutils.c b/liboctave/lo-cutils.c --- a/liboctave/lo-cutils.c +++ b/liboctave/lo-cutils.c @@ -127,6 +127,16 @@ return strncasecmp (s1, s2, n); } +OCTAVE_API mode_t +octave_umask (mode_t mode) +{ +#if defined (HAVE_UMASK) + return umask (mode); +#else + return 0; +#endif +} + OCTAVE_API int octave_gethostname (char *name, int namelen) { diff --git a/liboctave/lo-utils.h b/liboctave/lo-utils.h --- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -69,6 +69,8 @@ extern "C" OCTINTERP_API int octave_strncasecmp (const char *s1, const char *s2, size_t n); +extern "C" OCTAVE_API mode_t octave_umask (mode_t); + template T octave_read_value (std::istream& is)