1 Star 0 Fork 50

lxpzero/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0878-pstore-drop-unnecessary-initializations.patch 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2023-06-19 11:02 . update to systemd-239-74.el8_8
From 7e4b7cc35af0e3b3afbf32fa0fd9961cd01ad9a9 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Mon, 22 Jul 2019 10:52:12 +0900
Subject: [PATCH] pstore: drop unnecessary initializations
(cherry picked from commit 2e4effd129343d22bfed34e94810d3f87c8f0e85)
Related: #2158832
---
src/pstore/pstore.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
index f95e016eb6..e6a342fc50 100644
--- a/src/pstore/pstore.c
+++ b/src/pstore/pstore.c
@@ -113,14 +113,12 @@ static int compare_pstore_entries(const void *_a, const void *_b) {
}
static int move_file(PStoreEntry *pe, const char *subdir) {
- _cleanup_free_ char *ifd_path = NULL;
- _cleanup_free_ char *ofd_path = NULL;
- int r = 0;
- struct iovec iovec[2] = {};
- int n_iovec = 0;
+ _cleanup_free_ char *ifd_path = NULL, *ofd_path = NULL;
_cleanup_free_ void *field = NULL;
- const char *suffix = NULL;
+ struct iovec iovec[2];
+ const char *suffix;
size_t field_size;
+ int n_iovec = 0, r;
if (pe->handled)
return 0;
@@ -202,10 +200,9 @@ static int write_dmesg(const char *dmesg, size_t size, const char *id) {
static void process_dmesg_files(PStoreList *list) {
/* Move files, reconstruct dmesg.txt */
- PStoreEntry *pe;
- _cleanup_free_ char *dmesg = NULL;
+ _cleanup_free_ char *dmesg = NULL, *dmesg_id = NULL;
size_t dmesg_size = 0;
- _cleanup_free_ char *dmesg_id = NULL;
+ PStoreEntry *pe;
/* Handle each dmesg file: files processed in reverse
* order so as to properly reconstruct original dmesg */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lxpzero/systemd.git
git@gitee.com:lxpzero/systemd.git
lxpzero
systemd
systemd
a8

搜索帮助