Win32 has name conflict with ERROR
[p5sagit/p5-mst-13.2.git] / vms / vms.c
index 43a5c22..7e90656 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -759,7 +759,7 @@ Perl_vmssetuserlnm(char *name, char *eqv)
 {
     $DESCRIPTOR(d_tab, "LNM$PROCESS");
     struct dsc$descriptor_d d_name = {0,DSC$K_DTYPE_T,DSC$K_CLASS_D,0};
-    unsigned long int iss, attr = 0;
+    unsigned long int iss, attr = LNM$M_CONFINE;
     unsigned char acmode = PSL$C_USER;
     struct itmlst_3 lnmlst[2] = {{0, LNM$_STRING, 0, 0},
                                  {0, 0, 0, 0}};
@@ -1732,6 +1732,18 @@ struct _pipeloc {
 };
 static pPLOC  head_PLOC = 0;
 
+void
+free_pipelocs(void *head)
+{
+    pPLOC p, pnext;
+
+    p = (pPLOC) head;
+    while (p) {
+        pnext = p->next;
+        Safefree(p);
+        p = pnext;
+    }
+}
 
 static void
 store_pipelocs()
@@ -1798,7 +1810,7 @@ store_pipelocs()
         p->dir[NAM$C_MAXRSS] = '\0';
     }
 #endif
-
+    Perl_call_atexit(&free_pipelocs, head_PLOC);
 }
 
 
@@ -1886,8 +1898,8 @@ vmspipe_tempfile(void)
     fprintf(fp,"$ perl_del    = \"delete\"\n");
     fprintf(fp,"$ pif         = \"if\"\n");
     fprintf(fp,"$!  --- define i/o redirection (sys$output set by lib$spawn)\n");
-    fprintf(fp,"$ pif perl_popen_in  .nes. \"\" then perl_define/user sys$input  'perl_popen_in'\n");
-    fprintf(fp,"$ pif perl_popen_err .nes. \"\" then perl_define/user sys$error  'perl_popen_err'\n");
+    fprintf(fp,"$ pif perl_popen_in  .nes. \"\" then perl_define/user/name_attributes=confine sys$input  'perl_popen_in'\n");
+    fprintf(fp,"$ pif perl_popen_err .nes. \"\" then perl_define/user/name_attributes=confine sys$error  'perl_popen_err'\n");
     fprintf(fp,"$ pif perl_popen_out .nes. \"\" then perl_define      sys$output 'perl_popen_out'\n");
     fprintf(fp,"$ cmd = perl_popen_cmd\n");
     fprintf(fp,"$!  --- get rid of global symbols\n");
@@ -4759,10 +4771,10 @@ static unsigned int *sockflags, sockflagsize;
  * We don't shim the other file open routines since a socket isn't
  * likely to be opened by a name.
  */
-/*{{{ FILE *my_fdopen(int fd, char *mode)*/
-FILE *my_fdopen(int fd, char *mode)
+/*{{{ FILE *my_fdopen(int fd, const char *mode)*/
+FILE *my_fdopen(int fd, const char *mode)
 {
-  FILE *fp = fdopen(fd,mode);
+  FILE *fp = fdopen(fd, (char *) mode);
 
   if (fp) {
     unsigned int fdoff = fd / sizeof(unsigned int);