Subject: Re: [bug-diffutils] bug#20062: bug#20062: bug#20062: bug#20062: [PATCH] diff: add support for --color

From: Paul Eggert <[email-masked]>
Date: Sat, 12 Sep 2015 02:37:46 -0700

Giuseppe Scrivano wrote:
>   Would block signals between a set_*_color_context and
> reset_color_context be enough or do we need more granularity (there are
> many places where printf is used in the code)?

No, for reasons Eric described: output is buffered.

I suggest looking at the source code of GNU ls and seeing how it does things. 
In normal execution it never blocks signals at all.  (It temporarily blocks 
signals only when processing a signal.)