# HG changeset patch # User John W. Eaton # Date 1264058913 18000 # Node ID eb64bf1c61073a1932f5eacd3efb736b58cb50e9 # Parent 2b1f3f156aaf8b7188544e9fc874984311a751f4 use unlink module from gnulib diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-21 John W. Eaton + + * bootstrap.conf (gnulib_modules): Include unlink in the list. + 2010-01-21 John W. Eaton * bootstrap.conf (gnulib_modules): Include strptime in the list. diff --git a/bootstrap.conf b/bootstrap.conf --- a/bootstrap.conf +++ b/bootstrap.conf @@ -33,6 +33,7 @@ strftime strptime times + unlink round " 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_unlink): New funtion. + * lo-utils.h: Provide decl. + * file-ops.cc (file_ops::unlink): Call octave_unlink. + 2010-01-21 John W. Eaton * lo-cutils.c (octave_umask): New funtion. diff --git a/liboctave/file-ops.cc b/liboctave/file-ops.cc --- a/liboctave/file-ops.cc +++ b/liboctave/file-ops.cc @@ -833,17 +833,13 @@ int status = -1; -#if defined (HAVE_UNLINK) - status = ::unlink (name.c_str ()); + status = octave_unlink (name.c_str ()); if (status < 0) { using namespace std; msg = ::strerror (errno); } -#else - msg = NOT_SUPPORTED ("unlink"); -#endif return status; } diff --git a/liboctave/lo-cutils.c b/liboctave/lo-cutils.c --- a/liboctave/lo-cutils.c +++ b/liboctave/lo-cutils.c @@ -138,6 +138,12 @@ } OCTAVE_API int +octave_unlink (const char *name) +{ + return unlink (name); +} + +OCTAVE_API int octave_gethostname (char *name, int namelen) { return gethostname (name, namelen); diff --git a/liboctave/lo-utils.h b/liboctave/lo-utils.h --- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -71,6 +71,8 @@ extern "C" OCTAVE_API mode_t octave_umask (mode_t); +extern "C" OCTAVE_API int octave_unlink (const char *name); + template T octave_read_value (std::istream& is)