summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsiena <siena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-21 16:09:40 +0000
committersiena <siena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-21 16:09:40 +0000
commita065f0e575b2b45eb7dc6709bb06697fea99b1dd (patch)
treeb412040552759e85d53b7542d077ca5786f5a053
parent83f7f66588b0ad6fb1dd5189ab4dfd066ecd3488 (diff)
downloadruby-a065f0e575b2b45eb7dc6709bb06697fea99b1dd.tar.gz
ruby-a065f0e575b2b45eb7dc6709bb06697fea99b1dd.tar.xz
ruby-a065f0e575b2b45eb7dc6709bb06697fea99b1dd.zip
* configure.in: check availability of link(). [ruby-dev:22237]
* file.c (rb_file_s_link): raise an exception when link() is unavailable. * missing/os2.c (link): removed. File#link isn't supported. * bcc32/Makefile.sub: define HAVE_LINK to enable link(). [ruby-dev:22241] * win32/Makefile.sub: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--bcc32/Makefile.sub1
-rw-r--r--configure.in2
-rw-r--r--file.c5
-rw-r--r--missing/os2.c2
-rw-r--r--win32/Makefile.sub1
6 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5159a8656..04f50378c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Jan 22 00:33:52 2004 Siena. <siena@faculty.chiba-u.jp>
+
+ * configure.in: check availability of link(). [ruby-dev:22237]
+ * file.c (rb_file_s_link): raise an exception when link() is unavailable.
+ * missing/os2.c (link): removed. File#link isn't supported.
+ * bcc32/Makefile.sub: define HAVE_LINK to enable link(). [ruby-dev:22241]
+ * win32/Makefile.sub: ditto.
+
Thu Jan 22 00:26:25 2004 Siena. <siena@faculty.chiba-u.jp>
* ChangeLog: typo: RUBY_MBCHAR_MAX was RUBY_MBCHAR_MAXSIZE.
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index 09f5a029f..b735a80ac 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -246,6 +246,7 @@ config.h:
\#define HAVE_TIMES 1
/* \#define HAVE_UTIMES 1 */
/* \#define HAVE_FCNTL 1 */
+\#define HAVE_LINK 1
/* \#define HAVE_SETITIMER 1 */
/* \#define HAVE_GETGROUPS 1 */
/* \#define HAVE_SIGPROCMASK 1 */
diff --git a/configure.in b/configure.in
index f1b969d7b..4a875aba5 100644
--- a/configure.in
+++ b/configure.in
@@ -390,7 +390,7 @@ AC_REPLACE_FUNCS(dup2 memmove mkdir strcasecmp strncasecmp strerror strftime\
strchr strstr strtoul crypt flock vsnprintf\
isnan finite isinf hypot acosh erf)
AC_CHECK_FUNCS(fmod killpg wait4 waitpid syscall chroot fsync getcwd\
- truncate chsize times utimes fcntl lockf lstat symlink readlink\
+ truncate chsize times utimes fcntl lockf lstat link symlink readlink\
setitimer setruid seteuid setreuid setresuid setproctitle\
setrgid setegid setregid setresgid issetugid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\
diff --git a/file.c b/file.c
index 985fdc19a..0b6a0c3fb 100644
--- a/file.c
+++ b/file.c
@@ -1925,6 +1925,7 @@ static VALUE
rb_file_s_link(klass, from, to)
VALUE klass, from, to;
{
+#ifdef HAVE_LINK
SafeStringValue(from);
SafeStringValue(to);
@@ -1932,6 +1933,10 @@ rb_file_s_link(klass, from, to)
sys_fail2(from, to);
}
return INT2FIX(0);
+#else
+ rb_notimplement();
+ return Qnil; /* not reached */
+#endif
}
/*
diff --git a/missing/os2.c b/missing/os2.c
index 57798ab54..beea824b9 100644
--- a/missing/os2.c
+++ b/missing/os2.c
@@ -17,11 +17,13 @@ chown(char *path, int owner, int group)
return 0;
}
+#if 0
int
link(char *from, char *to)
{
return -1;
}
+#endif
typedef char* CHARP;
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 2719cb0b3..75f426c06 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -270,6 +270,7 @@ config.h:
#define HAVE_FSYNC 1
#define HAVE_CHSIZE 1
#define HAVE_TIMES 1
+#define HAVE_LINK 1
#define HAVE__SETJMP 1
#define HAVE_TELLDIR 1
#define HAVE_SEEKDIR 1