--- subversion/libsvn_subr/orig.io.c	Mon Sep 25 16:52:03 2006
+++ subversion/libsvn_subr/io.c	Mon Sep 25 16:50:27 2006
@@ -18,6 +18,11 @@
 
 
 
+#ifdef __MVS__
+#define _OPEN_SYS_FILE_EXT 1
+#include <sys/stat.h> /* for _chattr */
+#endif
+
 #include <stdio.h>
 #include <assert.h>
 
@@ -224,7 +229,27 @@
       flag &= ~APR_EXCL;
     }
 #endif /* AS400 */
-  return apr_file_open(f, fname, flag, perm, pool);
+
+  apr_status_t status = apr_file_open(f, fname, flag, perm, pool);
+
+#ifdef __MVS__
+  if (flag & APR_CREATE)
+    {
+      attrib_t attrs;
+
+      memset(&attrs, 0, sizeof(attrs));
+      attrs.att_filetagchg = 1;
+      attrs.att_filetag.ft_ccsid = 819; /* ASCII */
+      attrs.att_filetag.ft_txtflag = 1;
+
+      if (__chattr(fname, &attrs, sizeof(attrs)) == -1)
+        { 
+	  /* Ignore failure */
+        } 
+    }
+#endif /* __MVS__ */
+
+  return status;
 }
 
 

