From: Jan Friesse Date: Mon, 21 Feb 2011 12:23:46 +0000 (+0100) Subject: logsys: Properly lock flt data before dump X-Git-Tag: v1.99.0~399 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c5e823732504e0c6e9e0eb66870bcacafde080c9;p=mirror_corosync.git logsys: Properly lock flt data before dump Data needs to be locked, otherwise resulting fdata file may be incorrect. Signed-off-by: Jan Friesse Reviewed-by: Steven Dake --- diff --git a/exec/logsys.c b/exec/logsys.c index cbcfb0c6..c6786892 100644 --- a/exec/logsys.c +++ b/exec/logsys.c @@ -1617,6 +1617,8 @@ int logsys_log_rec_store (const char *filename) return (-1); } + logsys_flt_lock(); + this_write_size = write (fd, &flt_data_size, sizeof(uint32_t)); if (this_write_size != sizeof(unsigned int)) { goto error_exit; @@ -1643,10 +1645,12 @@ int logsys_log_rec_store (const char *filename) goto error_exit; } + logsys_flt_unlock(); close (fd); return (0); error_exit: + logsys_flt_unlock(); close (fd); return (-1); }