[llvm] r186530 - Add FILE_SHARE_WRITE to openFileForRead.

Reid Kleckner rnk at google.com
Wed Jul 17 12:59:00 PDT 2013


Does prog1 not terminate before prog2?

Anyway, I double-checked, and these flags are consistent with the default
for regular open(), so this should bring us back to the behavior we had
before splitting into openFileForRead().


On Wed, Jul 17, 2013 at 3:44 PM, Rafael Espindola <
rafael.espindola at gmail.com> wrote:

> Author: rafael
> Date: Wed Jul 17 14:44:07 2013
> New Revision: 186530
>
> URL: http://llvm.org/viewvc/llvm-project?rev=186530&view=rev
> Log:
> Add FILE_SHARE_WRITE to openFileForRead.
>
> This should fix the windows bots. It looks like the failing tests are of
> the
> form
>
> prog1 > file
> prog2 file
>
> and prog2 fails trying to read the file. The best fix would probably be to
> close
> stdout/stderr in prog1, but it was not the intention of 186511 to change
> this,
> so just restore the old behavior for now.
>
> Modified:
>     llvm/trunk/lib/Support/Windows/Path.inc
>
> Modified: llvm/trunk/lib/Support/Windows/Path.inc
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=186530&r1=186529&r2=186530&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Support/Windows/Path.inc (original)
> +++ llvm/trunk/lib/Support/Windows/Path.inc Wed Jul 17 14:44:07 2013
> @@ -1050,7 +1050,7 @@ error_code openFileForRead(const Twine &
>      return EC;
>
>    HANDLE H = ::CreateFileW(PathUTF16.begin(), GENERIC_READ,
> -                           FILE_SHARE_READ, NULL,
> +                           FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
>                             OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
>    if (H == INVALID_HANDLE_VALUE) {
>      error_code EC = windows_error(::GetLastError());
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130717/dde1eebc/attachment.html>


More information about the llvm-commits mailing list