# HG changeset patch # User John W. Eaton # Date 1264059446 18000 # Node ID d354be89b2c37de8e8ddc6b00d79e83ae9a200a3 # Parent eb64bf1c61073a1932f5eacd3efb736b58cb50e9 use link 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 link in the list. + 2010-01-21 John W. Eaton * bootstrap.conf (gnulib_modules): Include unlink in the list. diff --git a/bootstrap.conf b/bootstrap.conf --- a/bootstrap.conf +++ b/bootstrap.conf @@ -24,6 +24,7 @@ getopt-gnu gettimeofday glob + link lstat mkdir mkfifo 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_link): New funtion. + * lo-utils.h: Provide decl. + * file-ops.cc (file_ops::link): Call octave_link. + 2010-01-21 John W. Eaton * lo-cutils.c (octave_unlink): New funtion. diff --git a/liboctave/file-ops.cc b/liboctave/file-ops.cc --- a/liboctave/file-ops.cc +++ b/liboctave/file-ops.cc @@ -167,17 +167,13 @@ int status = -1; -#if defined (HAVE_LINK) - status = ::link (old_name.c_str (), new_name.c_str ()); + status = octave_link (old_name.c_str (), new_name.c_str ()); if (status < 0) { using namespace std; msg = ::strerror (errno); } -#else - msg = NOT_SUPPORTED ("link"); -#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 @@ -53,6 +53,12 @@ #include "syswait.h" OCTAVE_API int +octave_link (const char *old_name, const char *new_name) +{ + return link (old_name, new_name); +} + +OCTAVE_API int octave_mkdir (const char *name, mode_t mode) { return mkdir (name, mode); diff --git a/liboctave/lo-utils.h b/liboctave/lo-utils.h --- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -51,6 +51,9 @@ extern "C" OCTAVE_API int octave_gethostname (char *, int); +extern "C" OCTAVE_API int +octave_link (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);