Mercurial > hg > octave-lyh
changeset 10175:d354be89b2c3
use link module from gnulib
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 21 Jan 2010 02:37:26 -0500 |
parents | eb64bf1c6107 |
children | a0665fa8798c |
files | ChangeLog bootstrap.conf liboctave/ChangeLog liboctave/file-ops.cc liboctave/lo-cutils.c liboctave/lo-utils.h |
diffstat | 6 files changed, 21 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-21 John W. Eaton <jwe@octave.org> + + * bootstrap.conf (gnulib_modules): Include link in the list. + 2010-01-21 John W. Eaton <jwe@octave.org> * bootstrap.conf (gnulib_modules): Include unlink in the list.
--- a/bootstrap.conf +++ b/bootstrap.conf @@ -24,6 +24,7 @@ getopt-gnu gettimeofday glob + link lstat mkdir mkfifo
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2010-01-21 John W. Eaton <jwe@octave.org> + + * 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 <jwe@octave.org> * lo-cutils.c (octave_unlink): New funtion.
--- 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; }
--- 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);
--- 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);