systemd/0820-generator-uninline-generator_open_unit_file-and-gene.patch

71 lines
2.7 KiB
Diff
Raw Permalink Normal View History

From 52aaecf1e0eab132be1fd5f9267f8697e3d2bd42 Mon Sep 17 00:00:00 2001
From: Michal Sekletar <msekleta@redhat.com>
Date: Tue, 16 Jul 2024 18:19:45 +0200
Subject: [PATCH] generator: "uninline" generator_open_unit_file and
generator_add_symlink
Inlining of these functions changed ABI of libsystemd-shared which
causes issue on update when generators packaged in systemd-udev
subpackage fail to execute because of ABI change. systemd and the
library are already updated while systemd-udev subpackage is not and
hence old generators can't be started when systemd is reexecuting
due to internal library incompatibility.
rhel-only: bugfix
Resolves: RHEL-33436
---
src/shared/generator.c | 8 ++++++++
src/shared/generator.h | 10 ++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 29de8ada6b..a688ba446c 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -75,6 +75,10 @@ int generator_open_unit_file_full(
return 0;
}
+int generator_open_unit_file(const char *dest, const char *source, const char *name, FILE **ret_file) {
+ return generator_open_unit_file_full(dest, source, name, ret_file, NULL);
+}
+
int generator_add_symlink_full(
const char *dir,
const char *dst,
@@ -125,6 +129,10 @@ int generator_add_symlink_full(
return 0;
}
+int generator_add_symlink(const char *dir, const char *dst, const char *dep_type, const char *src) {
+ return generator_add_symlink_full(dir, dst, dep_type, src, NULL);
+}
+
static int generator_add_ordering(
const char *dir,
const char *src,
diff --git a/src/shared/generator.h b/src/shared/generator.h
index d97d6edc67..47feb496cf 100644
--- a/src/shared/generator.h
+++ b/src/shared/generator.h
@@ -7,16 +7,10 @@
#include "main-func.h"
int generator_open_unit_file_full(const char *dest, const char *source, const char *name, FILE **ret_file, char **ret_temp_path);
-
-static inline int generator_open_unit_file(const char *dest, const char *source, const char *name, FILE **ret_file) {
- return generator_open_unit_file_full(dest, source, name, ret_file, NULL);
-}
+int generator_open_unit_file(const char *dest, const char *source, const char *name, FILE **ret_file);
int generator_add_symlink_full(const char *dir, const char *dst, const char *dep_type, const char *src, const char *instance);
-
-static inline int generator_add_symlink(const char *dir, const char *dst, const char *dep_type, const char *src) {
- return generator_add_symlink_full(dir, dst, dep_type, src, NULL);
-}
+int generator_add_symlink(const char *dir, const char *dst, const char *dep_type, const char *src);
int generator_write_fsck_deps(
FILE *f,