]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/sigbus.c
path-util: make use of TAKE_PTR() where we can
[thirdparty/systemd.git] / src / basic / sigbus.c
index 0ce4f75684088df87190a3e7cb7ac949dad3bfc7..a065a45a8c0c8f8a35bc234950fef728690e7c7e 100644 (file)
@@ -1,21 +1,4 @@
-/***
-  This file is part of systemd.
-
-  Copyright 2014 Lennart Poettering
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
+/* SPDX-License-Identifier: LGPL-2.1+ */
 
 #include <errno.h>
 #include <signal.h>
@@ -23,8 +6,8 @@
 #include <sys/mman.h>
 
 #include "macro.h"
+#include "memory-util.h"
 #include "sigbus.h"
-#include "util.h"
 
 #define SIGBUS_QUEUE_MAX 64
 
@@ -130,6 +113,10 @@ void sigbus_install(void) {
                 .sa_flags = SA_SIGINFO,
         };
 
+        /* make sure that sysconf() is not called from a signal handler because
+        * it is not guaranteed to be async-signal-safe since POSIX.1-2008 */
+        (void) page_size();
+
         n_installed++;
 
         if (n_installed == 1)