changeset 10174:eb64bf1c6107

use unlink module from gnulib
author John W. Eaton <jwe@octave.org>
date Thu, 21 Jan 2010 02:28:33 -0500
parents 2b1f3f156aaf
children d354be89b2c3
files ChangeLog bootstrap.conf liboctave/ChangeLog liboctave/file-ops.cc liboctave/lo-cutils.c liboctave/lo-utils.h
diffstat 6 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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  <jwe@octave.org>
+
+	* bootstrap.conf (gnulib_modules): Include unlink in the list.
+
 2010-01-21  John W. Eaton  <jwe@octave.org>
 
 	* bootstrap.conf (gnulib_modules): Include strptime in the list.
--- 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
 "
 
--- 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  <jwe@octave.org>
+
+	* 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  <jwe@octave.org>
 
 	* lo-cutils.c (octave_umask): New funtion.
--- 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;
 }
--- 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);
--- 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 <typename T>
 T
 octave_read_value (std::istream& is)