Move the rest of the data munging into the test preparation loop.
[p5sagit/p5-mst-13.2.git] / t / op / chdir.t
index 14024a6..cb24da8 100644 (file)
@@ -48,7 +48,14 @@ SKIP: {
     ok(open(my $fh, "<", "op"), "open op");
     ok(chdir($fh), "fchdir op");
     ok(-f "chdir.t", "verify that we are in op");
-    ok(chdir($dh), "fchdir back");
+    if (($Config{d_dirfd} || "") eq "define") {
+       ok(chdir($dh), "fchdir back");
+    }
+    else {
+       eval { chdir($dh); };
+       like($@, qr/^The dirfd function is unimplemented at/, "dirfd is unimplemented");
+       chdir "..";
+    }
     ok(-d "op", "verify that we are back");
 }
 
@@ -131,6 +138,10 @@ END {
 
     # Restore the environment for VMS (and doesn't hurt for anyone else)
     @ENV{@magic_envs} = @Saved_Env{@magic_envs};
+
+    # On VMS this must be deleted or process table is wrong on exit
+    # when this script is run interactively.
+    delete $ENV{'SYS$LOGIN'} if $IsVMS;
 }