summaryrefslogtreecommitdiff
path: root/vms/vms.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2007-10-05 22:37:23 +0000
committerCraig A. Berry <craigberry@mac.com>2007-10-05 22:37:23 +0000
commit2ee6e19d6e437934eea429f654b31f6f5e36af58 (patch)
treea05be96c925ff2f3fdb3b03c2d8e661208a2973e /vms/vms.c
parent73031816b5ef6a74869c06e84bb621841a623d0a (diff)
downloadperl-2ee6e19d6e437934eea429f654b31f6f5e36af58.tar.gz
symlink() wrapper for VMS that prevents the creation of symlinks
with zero-length names. The standards disallow that and the test suite gets indigestion. p4raw-id: //depot/perl@32037
Diffstat (limited to 'vms/vms.c')
-rw-r--r--vms/vms.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 40e80a2f7d..01fb23534a 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -12721,7 +12721,22 @@ vms_realpath_fromperl(pTHX_ CV *cv)
Safefree(rslt_spec);
XSRETURN(1);
}
-#endif
+
+/*
+ * A thin wrapper around decc$symlink to make sure we follow the
+ * standard and do not create a symlink with a zero-length name.
+ */
+/*{{{ int my_symlink(const char *path1, const char *path2)*/
+int my_symlink(const char *path1, const char *path2) {
+ if (!path2 || !*path2) {
+ SETERRNO(ENOENT, SS$_NOSUCHFILE);
+ return -1;
+ }
+ return symlink(path1, path2);
+}
+/*}}}*/
+
+#endif /* HAS_SYMLINK */
#if __CRTL_VER >= 70301000 && !defined(__VAX)
int do_vms_case_tolerant(void);