From f6b2e0b167ed19aedef11c686441c8cfa284c1e1 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sun, 22 Jul 2012 17:43:24 +0200 Subject: [PATCH] fixed sporadic data loss on pid reuse --- CHANGES | 5 +++++ xioinitialize.c | 6 +++++- xiosigchld.c | 31 +++++++++++-------------------- xiosigchld.h | 14 ++++++++------ 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/CHANGES b/CHANGES index 40a149d..7b9125b 100644 --- a/CHANGES +++ b/CHANGES @@ -70,6 +70,11 @@ corrections: development had been aware that localtime() is not thread safe but had only expected broken messages, not corrupted stack (glibc 2.11.1, Ubuntu 10.4) + + an internal store for child pids was susceptible to pid reuse which + could lead to sporadic data loss when both fork option and exec address + were used. Thanks to Tetsuya Sodo for reporting this problem and + sending a patch docu mentions option so-bindtodev but correct name is so-bindtodevice. Thanks to Jim Zimmerman for reporting. diff --git a/xioinitialize.c b/xioinitialize.c index 0ab09c3..35d258f 100644 --- a/xioinitialize.c +++ b/xioinitialize.c @@ -1,5 +1,5 @@ /* source: xioinitialize.c */ -/* Copyright Gerhard Rieger 2001-2008 */ +/* Copyright Gerhard Rieger 2001-2012 */ /* Published under the GNU General Public License V.2, see file COPYING */ /* this file contains the source for the initialize function */ @@ -206,7 +206,11 @@ static int xio_nokill(xiofile_t *sock) { returns 0 on success or != 0 if an error occurred */ int xio_forked_inchild(void) { int result = 0; + int i; + for (i=0; i