DECC$POSIX_COMPLIANT_PATHNAMES break rename on directory
Defined DECC$POSIX_COMPLIANT_PATHNAMES to 2 break rename runtime functions.
Reproducer: Create the follownig procedure pb_pcp_rn.com
$ create bar.c
#include <stat.h>
#include <stdio.h>
#include <errno.h>
main() {
errno = 0;
printf("rename(\"foo\", \"bar\"): %d, errno:%d\n",
rename("foo", "bar"), errno);
perror("Error");
}
$
$ cc bar
$ link bar
$
$ create/dir [.foo]
$ set prot=o:rewd foo.dir;
$
$ write sys$output "with DECC$RENAME_NO_INHERIT"
$ define DECC$RENAME_NO_INHERIT 1
$ write sys$output ""
$ run bar
$ deass DECC$RENAME_NO_INHERIT
$ dir foo.DIR, bar.DIR
$
$ write sys$output ""
$ write sys$output ""
$ write sys$output "with DECC$POSIX_COMPLIANT_PATHNAMES defines to 2"
$ write sys$output ""
$ delete bar.DIR;
$ create/dir [.foo]
$ set prot=o:rewd foo.dir;
$ define DECC$POSIX_COMPLIANT_PATHNAMES 2
$ run bar
$ deass DECC$POSIX_COMPLIANT_PATHNAMES
$ dir foo.DIR, bar.DIR
$
$ delete foo.DIR;
$ if f$search("bar.DIR") then $ delete bar.DIR;
$ delete bar.c;*
$ delete bar.obj;*
$ delete bar.exe;*
$
Then running this file gives:
with DECC$RENAME_NO_INHERIT
rename("foo", "bar"): 0, errno:2
Error: no such file or directory
Directory DSA1:[USER.JFP.pb_POSIX_COMPLIANT_PATHNAMES]
BAR.DIR;1
Total of 1 file.
with DECC$POSIX_COMPLIANT_PATHNAMES defines to 2
rename("foo", "bar"): -1, errno:2
Error: no such file or directory
Directory DSA1:[USER.JFP.pb_POSIX_COMPLIANT_PATHNAMES]
foo.DIR;1
Total of 1 file.