[Bug other/108276] libiberty unlink_if_ordinary does not handle Windows nul device correctly
i.nixman at autistici dot org
gcc-bugzilla@gcc.gnu.org
Mon Jan 16 16:23:30 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108276
--- Comment #2 from niXman <i.nixman at autistici dot org> ---
@Himal
```
+#ifdef _WIN32
+ if (stricmp (name, "nul") == 0)
+ return 1;
+#else
struct stat st;
if (lstat (name, &st) == 0
&& (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
return unlink (name);
+#endif
```
I don't think the patch is correct because for WIN32 platform `unlink()` will
never be called even for non-"nul" files.
right?
More information about the Gcc-bugs
mailing list