# HG changeset patch # User John W. Eaton # Date 1264058913 18000 # Node ID eb64bf1c61073a1932f5eacd3efb736b58cb50e9 # Parent 2b1f3f156aaf8b7188544e9fc874984311a751f4 use unlink module from gnulib diff -r 2b1f3f156aaf -r eb64bf1c6107 ChangeLog --- a/ChangeLog Thu Jan 21 02:25:53 2010 -0500 +++ b/ChangeLog Thu Jan 21 02:28:33 2010 -0500 @@ -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 -r 2b1f3f156aaf -r eb64bf1c6107 bootstrap.conf --- a/bootstrap.conf Thu Jan 21 02:25:53 2010 -0500 +++ b/bootstrap.conf Thu Jan 21 02:28:33 2010 -0500 @@ -33,6 +33,7 @@ strftime strptime times + unlink round " diff -r 2b1f3f156aaf -r eb64bf1c6107 liboctave/ChangeLog --- a/liboctave/ChangeLog Thu Jan 21 02:25:53 2010 -0500 +++ b/liboctave/ChangeLog Thu Jan 21 02:28:33 2010 -0500 @@ -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 -r 2b1f3f156aaf -r eb64bf1c6107 liboctave/file-ops.cc --- a/liboctave/file-ops.cc Thu Jan 21 02:25:53 2010 -0500 +++ b/liboctave/file-ops.cc Thu Jan 21 02:28:33 2010 -0500 @@ -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 -r 2b1f3f156aaf -r eb64bf1c6107 liboctave/lo-cutils.c --- a/liboctave/lo-cutils.c Thu Jan 21 02:25:53 2010 -0500 +++ b/liboctave/lo-cutils.c Thu Jan 21 02:28:33 2010 -0500 @@ -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 -r 2b1f3f156aaf -r eb64bf1c6107 liboctave/lo-utils.h --- a/liboctave/lo-utils.h Thu Jan 21 02:25:53 2010 -0500 +++ b/liboctave/lo-utils.h Thu Jan 21 02:28:33 2010 -0500 @@ -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)