Re: [PATCH 2/5] multipath-tools: fix -Wformat errors with musl libc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/27/20 11:45 PM, mwilck@xxxxxxxx wrote:
From: Martin Wilck <mwilck@xxxxxxxx>

rlim_t type is different on musl libc. A cast to unsigned long
should be fine. Also, in musl, pthread_t is a pointer.

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>

Tested-by: Xose Vazquez Perez <xose.vazquez@xxxxxxxxx>

---
  libmultipath/util.c | 6 ++++--
  multipathd/waiter.c | 2 +-
  2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libmultipath/util.c b/libmultipath/util.c
index 1dad90f..39ccace 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -378,11 +378,13 @@ void set_max_fds(rlim_t max_fds)
  		if (setrlimit(RLIMIT_NOFILE, &fd_limit) < 0) {
  			condlog(0, "can't set open fds limit to "
  				"%lu/%lu : %s",
-				fd_limit.rlim_cur, fd_limit.rlim_max,
+				(unsigned long)fd_limit.rlim_cur,
+				(unsigned long)fd_limit.rlim_max,
  				strerror(errno));
  		} else {
  			condlog(3, "set open fds limit to %lu/%lu",
-				fd_limit.rlim_cur, fd_limit.rlim_max);
+				(unsigned long)fd_limit.rlim_cur,
+				(unsigned long)fd_limit.rlim_max);
  		}
  	}
  }
diff --git a/multipathd/waiter.c b/multipathd/waiter.c
index 16fbdc8..3bc6980 100644
--- a/multipathd/waiter.c
+++ b/multipathd/waiter.c
@@ -64,7 +64,7 @@ void stop_waiter_thread (struct multipath *mpp)
  		return;
condlog(3, "%s: stop event checker thread (%lu)", mpp->alias,
-		mpp->waiter);
+		(unsigned long)mpp->waiter);
  	thread = mpp->waiter;
  	mpp->waiter = (pthread_t)0;
  	pthread_cleanup_push(cleanup_lock, &waiter_lock);


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux