fix bugfix when exec lsmd help attach daemon

This commit is contained in:
markeryang 2021-07-27 16:01:15 +08:00
parent 6b4d35fa95
commit 762cdada49
2 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,51 @@
From 53593fddd4a243c6eb38794d1a4416db11bd5ec2 Mon Sep 17 00:00:00 2001
From: Wu Bo <wubo40@huawei.com>
Date: Tue, 2 Jun 2020 11:49:10 +0800
Subject: [PATCH] fix bugfix when exec lsmd help attach daemon
$ lsmd --help
libStorageMgmt plug-in daemon.
lsmd [--plugindir <directory>] [--socketdir <dir>] [-v] [-d]
--plugindir = The directory where the plugins are located
--socketdir = The directory where the Unix domain sockets will be created
--confdir = The directory where the config files are located
-v = Verbose logging
-d = New style daemon (systemd)
$ ps -ef | grep lsmd
libstor+ 1366 1 0 Sep23 ? 00:00:00 /usr/bin/lsmd -d
Signed-off-by: Wu Bo <wubo40@huawei.com>
---
daemon/lsm_daemon.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/daemon/lsm_daemon.c b/daemon/lsm_daemon.c
index dc4df3b..65e337d 100644
--- a/daemon/lsm_daemon.c
+++ b/daemon/lsm_daemon.c
@@ -829,6 +829,11 @@ int main(int argc, char *argv[])
break;
}
+ if (c == 'h') {
+ usage();
+ return EXIT_SUCCESS;
+ }
+
switch (c) {
case 0:
switch (option_index) {
@@ -844,10 +849,6 @@ int main(int argc, char *argv[])
}
break;
- case 'h':
- usage();
- break;
-
case 'v':
verbose_flag = 1;
break;
--
1.8.3.1

View File

@ -2,13 +2,14 @@
%define with_python2 0
Name: libstoragemgmt
Version: 1.8.0
Release: 5
Release: 6
Summary: Storage array management library
License: LGPLv2+
URL: https://github.com/libstorage/libstoragemgmt
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-change-run-dir.patch
Patch2: 0002-fix-bugfix-when-exec-lsmd-help-attach-daemon.patch
BuildRequires: gcc gcc-c++ autoconf automake libtool libxml2-devel check-devel perl-interpreter
BuildRequires: openssl-devel glib2-devel systemd bash-completion libconfig-devel systemd-devel
@ -370,6 +371,9 @@ fi
%{_mandir}/man*/*
%changelog
* Tue Jul 27 2021 yannglongkang <yanglongkang@huawei.com> - 1.8.0-6
- fix bugfix when exec lsmd help attach daemon
* Tue Sep 29 2020 baizhonggui <baizhonggui@huawei.com> - 1.8.0-5
- Modify source0