https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108276
Bug ID: 108276
Summary: libiberty unlink_if_ordinary does not handle Windows
nul device correctly
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: himalr at proton dot me
Target Milestone: ---
Created attachment 54180
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54180&action=edit
Handle Windows nul device correctly in unlink_if_ordinary function
I reported this as a part of another bug to [Sourceware
Bugzilla](https://sourceware.org/bugzilla/show_bug.cgi?id=29947) and was asked
to report this here.
In Windows, 'stat' function (and in turn, S_ISREG) returns true for null device
as a regular file.
Please note that I'm not a C programmer so let me know if there are any issues
with the patch.
Thanks.