Commit c442328
Win32: let mingw_lstat() error early upon problems with reparse points
When obtaining lstat information for reparse points, we need to call
FindFirstFile() in addition to GetFileInformationEx() to obtain the type
of the reparse point (symlink, mount point etc.). However, currently there
is no error handling whatsoever if FindFirstFile() fails.
Call FindFirstFile() before modifying the stat *buf output parameter and
error out if the call fails.
Note: The FindFirstFile() return value includes all the data that we get
from GetFileAttributesEx(), so we could replace GetFileAttributesEx() with
FindFirstFile(). We don't do that because GetFileAttributesEx() is about
twice as fast for single files. I.e. we only pay the extra cost of calling
FindFirstFile() in the rare case that we encounter a reparse point.
Note: The indentation of the remaining reparse point code will be fixed in
the next patch.
Signed-off-by: Karsten Blees <blees@dcon.de>1 parent 2bcb1bd commit c442328
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| 711 | + | |
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
| |||
722 | 723 | | |
723 | 724 | | |
724 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
725 | 733 | | |
726 | 734 | | |
727 | 735 | | |
| |||
734 | 742 | | |
735 | 743 | | |
736 | 744 | | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | 745 | | |
741 | 746 | | |
742 | 747 | | |
743 | 748 | | |
744 | 749 | | |
745 | 750 | | |
746 | | - | |
747 | | - | |
748 | 751 | | |
749 | 752 | | |
750 | 753 | | |
| 754 | + | |
751 | 755 | | |
752 | 756 | | |
753 | 757 | | |
| |||
0 commit comments