<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 9, 2017 at 12:14 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Rui Ueyama via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> ruiu added inline comments.<br>
><br>
><br>
> ================<br>
> Comment at: lib/Support/FileOutputBuffer.<wbr>cpp:63<br>
>          return EC;<br>
>        else<br>
> +        IsRegular = false;<br>
> ----------------<br>
> Remove `else`.<br>
</span>Will do.<br>
<span class="gmail-"><br>
> ================<br>
> Comment at: lib/Support/FileOutputBuffer.<wbr>cpp:74<br>
><br>
>    // Create new file in same directory but with random name.<br>
>    SmallString<128> TempFilePath;<br>
> ----------------<br>
> Update the comment.<br>
</span>Will do.<br>
<span class="gmail-"><br>
> ================<br>
> Comment at: lib/Support/FileOutputBuffer.<wbr>cpp:92<br>
><br>
>    sys::RemoveFileOnSignal(<wbr>TempFilePath);<br>
><br>
> ----------------<br>
> You want to call this only when IsRegular.<br>
<br>
</span>Why? It is a good think to remove the temporary file in both cases.<br></blockquote><div><br></div><div>Sorry, I misunderstood the code. This part looks fine.</div><div><br></div><div>But why do you call DontRemoveFileOnSignal on commit()? I think you want to remove a temporary file on commit.</div><div><br></div><div>Does sys::fs::rename() work on two paths that reside in different filesystems? The comment for the function says that it uses POSIX rename(), which I believe doesn't work across filesystems.</div></div></div></div>