[vlc-devel] [PATCH v2 05/18] newlib/nacl: Provide flockfile implementation

Julian Scheel julian at jusst.de
Tue Mar 14 11:07:02 CET 2017


On 13.03.2017 21:14, Rémi Denis-Courmont wrote:
> Le maanantaina 13. maaliskuuta 2017, 20.45.08 EET Dennis Hamester a écrit :
>>> That does not answer the question. This only makes sense if NaCl has
>>> Windows- compatible _lock_file().
>>
>> The use of _lock_file is guarded by an #ifndef HAVE__LOCK_FILE. On NaCl,
>> that is not the case -> Everyone is happy.
>
> I don´t currently use Native Client. If I did, I wouldn´t be happy to have
> unusable logs, if not crashes, due to concurrent access to FILE pointers.
>
> But in any case, this code only makes sense on Windows, and it´s only that way
> to work around a MingW problem. (I don´t know if it´s a MingW bug or a VLC
> build misconfiguration.) Using it for anything else is confusing and likely to
> explode when the MingW problem is resolved - and the code removed.
>

nacl-newlib provides a _flockfile/_funlockfile implementation which 
works, but is declared as internal in a comment in the declaring header 
(sys/stdio.h). But as sys/stdio.h is included from stdio.h it is 
actually publicly visible and usable.
Would you be happy if we make use of that?
The other option would be having no locking for logging as it is now. 
Just moving it to a dedicated #ifdef case to avoid conflicts with win32.


More information about the vlc-devel mailing list