windows: Fix named pipes detection

The _wstati64 call succeeds on named pipes, so to check correctly you
must first check the result of WaitNamedPipeW.
This commit is contained in:
Anton Mitrofanov
2025-06-06 21:46:38 +03:00
committed by Anton Mitrofanov
parent 714e07b477
commit 291476d733
+2 -3
View File
@@ -247,9 +247,8 @@ static inline int x264_is_regular_file_path( const char *path )
if( path_utf16 )
{
x264_struct_stat buf;
if( _wstati64( path_utf16, &buf ) )
ret = !WaitNamedPipeW( path_utf16, 0 );
else
ret = !(WaitNamedPipeW( path_utf16, 0 ) || GetLastError() == ERROR_SEM_TIMEOUT);
if( ret && !_wstati64( path_utf16, &buf ) )
ret = S_ISREG( buf.st_mode );
if( path_utf16 != path_buf )
free( path_utf16 );