changeset 10176:a0665fa8798c

use symlink module from gnulib
author John W. Eaton <jwe@octave.org>
date Thu, 21 Jan 2010 02:41:50 -0500
parents d354be89b2c3
children cb3d926b4d9e
files ChangeLog bootstrap.conf liboctave/ChangeLog liboctave/file-ops.cc liboctave/lo-cutils.c liboctave/lo-utils.h
diffstat 6 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jan 21 02:37:26 2010 -0500
+++ b/ChangeLog	Thu Jan 21 02:41:50 2010 -0500
@@ -1,3 +1,7 @@
+2010-01-21  John W. Eaton  <jwe@octave.org>
+
+	* bootstrap.conf (gnulib_modules): Include symlink in the list.
+
 2010-01-21  John W. Eaton  <jwe@octave.org>
 
 	* bootstrap.conf (gnulib_modules): Include link in the list.
--- a/bootstrap.conf	Thu Jan 21 02:37:26 2010 -0500
+++ b/bootstrap.conf	Thu Jan 21 02:41:50 2010 -0500
@@ -33,6 +33,7 @@
   stat
   strftime
   strptime
+  symlink
   times
   unlink
   round
--- a/liboctave/ChangeLog	Thu Jan 21 02:37:26 2010 -0500
+++ b/liboctave/ChangeLog	Thu Jan 21 02:41:50 2010 -0500
@@ -1,3 +1,9 @@
+2010-01-21  John W. Eaton  <jwe@octave.org>
+
+	* lo-cutils.c (octave_symlink): New funtion.
+	* lo-utils.h: Provide decl.
+	* file-ops.cc (file_ops::symlink): Call octave_symlink.
+
 2010-01-21  John W. Eaton  <jwe@octave.org>
 
 	* lo-cutils.c (octave_link): New funtion.
--- a/liboctave/file-ops.cc	Thu Jan 21 02:37:26 2010 -0500
+++ b/liboctave/file-ops.cc	Thu Jan 21 02:41:50 2010 -0500
@@ -195,18 +195,13 @@
 
   int status = -1;
 
-#if defined (HAVE_SYMLINK)
-
-  status = ::symlink (old_name.c_str (), new_name.c_str ());
+  status = octave_symlink (old_name.c_str (), new_name.c_str ());
 
   if (status < 0)
     {
       using namespace std;
       msg = ::strerror (errno);
     }
-#else
-  msg = NOT_SUPPORTED ("symlink");
-#endif
 
   return status;
 }
--- a/liboctave/lo-cutils.c	Thu Jan 21 02:37:26 2010 -0500
+++ b/liboctave/lo-cutils.c	Thu Jan 21 02:41:50 2010 -0500
@@ -59,6 +59,12 @@
 }
 
 OCTAVE_API int
+octave_symlink (const char *old_name, const char *new_name)
+{
+  return symlink (old_name, new_name);
+}
+
+OCTAVE_API int
 octave_mkdir (const char *name, mode_t mode)
 {
   return mkdir (name, mode);
--- a/liboctave/lo-utils.h	Thu Jan 21 02:37:26 2010 -0500
+++ b/liboctave/lo-utils.h	Thu Jan 21 02:41:50 2010 -0500
@@ -54,6 +54,9 @@
 extern "C" OCTAVE_API int
 octave_link (const char *old_name, const char *new_name);
 
+extern "C" OCTAVE_API int
+octave_symlink (const char *old_name, const char *new_name);
+
 extern "C" OCTAVE_API int octave_mkdir (const char *name, mode_t mode);
 
 extern "C" OCTAVE_API int octave_mkfifo (const char *name, mode_t mode);