fix: read pid cmdline incorrect
This commit is contained in:
parent
1e956f5637
commit
2458ef3e28
27
backport-fix-read-pid-cmdline-incorrect.patch
Normal file
27
backport-fix-read-pid-cmdline-incorrect.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From 9fc2f5912a3fa2fa5a61c62f85a8a81e459f2965 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhangyao2022 <zhangyao108@huawei.com>
|
||||||
|
Date: Wed, 10 Apr 2024 17:16:04 +0800
|
||||||
|
Subject: [PATCH] fix: read pid cmdline incorrect
|
||||||
|
|
||||||
|
---
|
||||||
|
libs/basic/src/cmdline.rs | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libs/basic/src/cmdline.rs b/libs/basic/src/cmdline.rs
|
||||||
|
index 52cdf5c3..952ec34f 100644
|
||||||
|
--- a/libs/basic/src/cmdline.rs
|
||||||
|
+++ b/libs/basic/src/cmdline.rs
|
||||||
|
@@ -48,8 +48,8 @@ impl Cmdline {
|
||||||
|
if let Ok(mut file) = File::open(path) {
|
||||||
|
let mut data = String::new();
|
||||||
|
if file.read_to_string(&mut data).is_ok() {
|
||||||
|
- *cmdline = data.clone();
|
||||||
|
- for item in data.split_whitespace() {
|
||||||
|
+ *cmdline = data.replace("\0", " ").trim().to_string();
|
||||||
|
+ for item in cmdline.split_whitespace() {
|
||||||
|
let mut parts = item.splitn(2, '=');
|
||||||
|
let key = parts.next().unwrap_or_default().to_string();
|
||||||
|
let value = parts.next().map(|v| v.to_string());
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
Name: sysmaster
|
Name: sysmaster
|
||||||
Version: 1.0.0
|
Version: 1.0.0
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: redesign and reimplement process1.
|
Summary: redesign and reimplement process1.
|
||||||
|
|
||||||
License: Mulan PSL v2
|
License: Mulan PSL v2
|
||||||
@ -21,6 +21,7 @@ Source0: %{name}-%{version}.tar.xz
|
|||||||
|
|
||||||
Patch0: backport-feature-devmaster-add-net_driver-builtin-to-be-compa.patch
|
Patch0: backport-feature-devmaster-add-net_driver-builtin-to-be-compa.patch
|
||||||
Patch1: backport-fix-resolve-wantedby-invalid.patch
|
Patch1: backport-fix-resolve-wantedby-invalid.patch
|
||||||
|
Patch2: backport-fix-read-pid-cmdline-incorrect.patch
|
||||||
|
|
||||||
ExclusiveArch: x86_64 aarch64
|
ExclusiveArch: x86_64 aarch64
|
||||||
|
|
||||||
@ -162,6 +163,9 @@ if [ $1 -eq 0 ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Apr 11 2024 zhangyao<zhangyao108@huawei.com> - 1.0.0-4
|
||||||
|
- read pid cmdline incorrect
|
||||||
|
|
||||||
* Wed Apr 10 2024 zhangyao<zhangyao108@huawei.com> - 1.0.0-3
|
* Wed Apr 10 2024 zhangyao<zhangyao108@huawei.com> - 1.0.0-3
|
||||||
- resolve wantedby invalid and fix reboot symlink not correct after reinstall
|
- resolve wantedby invalid and fix reboot symlink not correct after reinstall
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user