# HG changeset patch # User John W. Eaton # Date 1264059710 18000 # Node ID a0665fa8798cec267257782aa91f38a8994dcd1f # Parent d354be89b2c37de8e8ddc6b00d79e83ae9a200a3 use symlink module from gnulib diff -r d354be89b2c3 -r a0665fa8798c ChangeLog --- 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 + + * bootstrap.conf (gnulib_modules): Include symlink in the list. + 2010-01-21 John W. Eaton * bootstrap.conf (gnulib_modules): Include link in the list. diff -r d354be89b2c3 -r a0665fa8798c bootstrap.conf --- 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 diff -r d354be89b2c3 -r a0665fa8798c liboctave/ChangeLog --- 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 + + * 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 * lo-cutils.c (octave_link): New funtion. diff -r d354be89b2c3 -r a0665fa8798c liboctave/file-ops.cc --- 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; } diff -r d354be89b2c3 -r a0665fa8798c liboctave/lo-cutils.c --- 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); diff -r d354be89b2c3 -r a0665fa8798c liboctave/lo-utils.h --- 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);