1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/libdaemon
Zdenek Kabelac 79cdfc8ca6 libdaemon: implement daemon_close_stray_fds
Refactor existing code from tools/lvmcmdline.c to
libdaemon/server/daemon-stray.h daemon_close_stray_fds()
used to close stray descriptors above some specified Fd.

This is code parses content of /proc dir to minimize 'blind' closing
of all possible descriptors within rlimits range.

As we have the same code in few other places in it's more 'trivial'
version - these were actually sensitive to high amount of descriptors,
which might be configured on some system.

With this patch we effectively resolve this reported gitlab issue:
https://gitlab.com/lvmteam/lvm2/-/issues/5

TODO: Current placement might not be ideal - however considering
existing code base constrains it's not so simple.
ATM it uses lib/misc/lvm-file.h  for custom_fds declaration
and rest of functinality is included in daemon header file.
2024-04-15 13:38:44 +02:00
..
client cov: replace strcpy with memcpy 2024-04-10 00:03:09 +02:00
server libdaemon: implement daemon_close_stray_fds 2024-04-15 13:38:44 +02:00
Makefile.in build: Remove reference to undefined @BUILD_LVMETAD@ 2018-12-18 09:54:45 +01:00