[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Freeipa-devel] [PATCHES] 206-209 Add default CFLAGS & fix hardened build

On Thu, 05 Dec 2013, Petr Viktorin wrote:
On 12/05/2013 11:15 AM, Jan Cholasta wrote:

the attached patches fix <https://fedorahosted.org/freeipa/ticket/3896>.

Patch 207 should fix build failures some of you were having after
hardenening was enabled in the spec file.


In 209, would (ret != 1) make more sense than (ret == -1)? AFAIU zero would also indicate a problem, if it somehow ended up being returned.
no, write() returns -1 if an error has happened and amount of the data
written otherwise. We specifically need to check that there was an
error, not that we wrote more or less than were supposed to write.

We are looking for EPIPE and EINTR mostly, since other errors make little
difference for our case. In case of EINTR we need to repeat or the
worker thread didn't receive our shutdown request. In case of EPIPE we
will also get SIGPIPE and in general this means the other thread died..

However, even if writing to the pipe failed, we still need to wait until
thread dies with pthread_join(). I think returning -1 here is premature.
/ Alexander Bokovoy

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]