[vlc-commits] file logger: do not disable buffering

Hannes Domani ssbssa at yahoo.de
Thu Dec 28 16:50:52 CET 2017


Hello

 > vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 14 17:55:21 2017 +0200| [b97304c176693014c70d947d7ce236ffdef13bbe] | committer: Rémi Denis-Courmont
> 
> file logger: do not disable buffering
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b97304c176693014c70d947d7ce236ffdef13bbe
> ---
> 
>  modules/logger/file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/logger/file.c b/modules/logger/file.c
> index 48c0d8c45e..6b6dfd2973 100644
> --- a/modules/logger/file.c
> +++ b/modules/logger/file.c
> @@ -173,7 +173,7 @@ static vlc_log_cb Open(vlc_object_t *obj, void **restrict sysp)
>      }
>      free(path);
>  
> -    setvbuf(sys->stream, NULL, _IONBF, 0);
> +    setvbuf(sys->stream, NULL, _IOLBF, 0);
>      fputs(header, sys->stream);
>  
>      *sysp = sys;

On windows this seems to be a problem because _IOLBF is actually the same as _IOFBF (full buffering).
And the minimum value, if the mode is not _IONBF, is 2 (is this different on linux, is there no minimum size value?).
So this doesn't actually do anything on windows, and if vlc crashes, the log is truncated.


Regards
Domani Hannes


More information about the vlc-devel mailing list