From 0ea83c658c1652bdd1b4d47ff9f6a3d7f0d14529 Mon Sep 17 00:00:00 2001
From: Jack Wilsdon <jack@wilsdon.me>
Date: Thu, 17 Oct 2024 20:38:41 +0100
Subject: [PATCH] libdaemon: fix suppressing stray fd warnings

Restore support for LVM_SUPPRESS_FD_WARNINGS as
this was seemingly lost with refactoring to
use daemon_close_stray_fds().
---
 libdaemon/server/daemon-stray.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libdaemon/server/daemon-stray.h b/libdaemon/server/daemon-stray.h
index cfce85622a68..beedbe44e44b 100644
--- a/libdaemon/server/daemon-stray.h
+++ b/libdaemon/server/daemon-stray.h
@@ -104,16 +104,15 @@ static void _daemon_close_descriptor(int fd, unsigned suppress_warnings,
  * Note: when 'from_fd' is set to -1,  unused 'custom_fds' must use same value!
  *
  * command:		print command name with warning message
- * suppress_warning:	whether to print warning messages
+ * suppress_warnings:	whether to print warning messages
  * above_fd:		close all descriptors above this descriptor
  * custom_fds:		preserve descriptors from this set of descriptors
  */
-static int daemon_close_stray_fds(const char *command, int suppress_warning,
+static int daemon_close_stray_fds(const char *command, int suppress_warnings,
 				  int from_fd, const struct custom_fds *custom_fds)
 {
 	struct rlimit rlim;
 	int fd;
-	unsigned suppress_warnings = 0;
 	pid_t ppid = getppid();
 	char parent_cmdline[64];
 	static const char _fd_dir[] = DEFAULT_PROC_DIR "/self/fd";
-- 
2.50.1 (Apple Git-155)

