summaryrefslogtreecommitdiffstats
path: root/src/home
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2025-01-15 18:41:51 +0100
committerMike Yuan <me@yhndnzj.com>2025-01-16 02:26:56 +0100
commit70923ed358d37e9b05d31556f1cb345e275c6f5d (patch)
treed2ac3dba6cf3a5a8a28e9072733417496fd65f5f /src/home
parenttree-wide: remove unnecessary gcc >= 7 version check (diff)
downloadsystemd-70923ed358d37e9b05d31556f1cb345e275c6f5d.tar.xz
systemd-70923ed358d37e9b05d31556f1cb345e275c6f5d.zip
meson: enable -Wzero-as-null-pointer-constant
Support for C added in gcc 15: https://github.com/gcc-mirror/gcc/commit/236c0829ee21a179c81b83f0d7f112ca23c47a4d
Diffstat (limited to 'src/home')
-rw-r--r--src/home/homed-gperf.gperf3
-rw-r--r--src/home/homed-manager.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/home/homed-gperf.gperf b/src/home/homed-gperf.gperf
index 9c1028642e..d5b798a411 100644
--- a/src/home/homed-gperf.gperf
+++ b/src/home/homed-gperf.gperf
@@ -1,6 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
%{
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#if __GNUC__ >= 15
+_Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "homed-conf.h"
diff --git a/src/home/homed-manager.c b/src/home/homed-manager.c
index de7c3d8dbe..bb4ad1f99f 100644
--- a/src/home/homed-manager.c
+++ b/src/home/homed-manager.c
@@ -1455,7 +1455,7 @@ static int manager_generate_key_pair(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to open key file for writing: %m");
- if (PEM_write_PrivateKey(fprivate, m->private_key, NULL, NULL, 0, NULL, 0) <= 0)
+ if (PEM_write_PrivateKey(fprivate, m->private_key, NULL, NULL, 0, NULL, NULL) <= 0)
return log_error_errno(SYNTHETIC_ERRNO(EIO), "Failed to write private key pair.");
r = fflush_sync_and_check(fprivate);