Open err redirection the same as output redirection. Batch file does not need to...
authorBrandon Turner <turnerb7@msu.edu>
Sat, 20 Aug 2005 18:30:25 +0000 (18:30 +0000)
committerBrandon Turner <turnerb7@msu.edu>
Sat, 20 Aug 2005 18:30:25 +0000 (18:30 +0000)
svn path=/trunk/; revision=17451

reactos/subsys/system/cmd/batch.c
reactos/subsys/system/cmd/cmd.c

index 09d6484..e414866 100644 (file)
@@ -221,7 +221,7 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param)
        SetLastError(0);
        hFile = CreateFile (fullname, GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
                            OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |
-                                FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_WRITE_THROUGH, NULL);    
+                                FILE_FLAG_SEQUENTIAL_SCAN, NULL);      
 
 #ifdef _DEBUG
        DebugPrintf (_T("Batch: (\'%s\', \'%s\', \'%s\')  hFile = %x\n"),
index ad5954e..91790e5 100644 (file)
@@ -796,9 +796,9 @@ VOID ParseCommandLine (LPTSTR cmd)
       }
       
       out[size]=_T('\0');
-      hFile = CreateFile (out, GENERIC_WRITE, FILE_SHARE_WRITE, &sa,
+      hFile = CreateFile (out, GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE, &sa,
                                    (nRedirFlags & OUTPUT_APPEND) ? OPEN_ALWAYS : CREATE_ALWAYS,
-                                   FILE_ATTRIBUTE_NORMAL, NULL);
+                                   FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, NULL);
 
      if (hFile == INVALID_HANDLE_VALUE)
      {
@@ -858,10 +858,10 @@ VOID ParseCommandLine (LPTSTR cmd)
                {
                        hFile = CreateFile (err,
                                            GENERIC_WRITE,
-                                           0,
+                                           FILE_SHARE_WRITE | FILE_SHARE_READ | FILE_SHARE_DELETE,
                                            &sa,
                                            (nRedirFlags & ERROR_APPEND) ? OPEN_ALWAYS : CREATE_ALWAYS,
-                                           FILE_ATTRIBUTE_NORMAL,
+                                           FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH,
                                            NULL);
                        if (hFile == INVALID_HANDLE_VALUE)
                        {