[ClusterLabs/libqb] 75ab31: ipc_shm: Don't truncate SHM files of an active ser...
by Chrissie Caulfield
Branch: refs/heads/master
Home: https://github.com/ClusterLabs/libqb
Commit: 75ab31bdd05a15947dc56edf4d6b7f377355435e
https://github.com/ClusterLabs/libqb/commit/75ab31bdd05a15947dc56edf4d6b7...
Author: Chrissie Caulfield <ccaulfie(a)redhat.com>
Date: 2018-04-20 (Fri, 20 Apr 2018)
Changed paths:
M include/qb/qbipcs.h
M lib/ipc_int.h
M lib/ipc_setup.c
M lib/ipc_shm.c
M tests/check_ipc.c
Log Message:
-----------
ipc_shm: Don't truncate SHM files of an active server (#307)
* ipc_shm: Don't truncate SHM files of an active server
I've put in an extra check so that clients don't truncate the
SHM file if the server still exists. Sadly on FreeBSD we can't
get the server PID for the client (unless someone has a patch handy!)
so we still do the truncate when disconnected. As a backstop (and also
to cover the BSD issue) I've added a SIGBUS trap to the server shutdown
so that it doesn't cause a server crash.
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
Reviewed by: Jan Friesse <jfriesse(a)redhat.com>
6 years