return 1;
}
-static int binfmt_mounted_warn(void) {
+static int binfmt_mounted_and_writable_warn(void) {
int r;
- r = binfmt_mounted();
+ r = binfmt_mounted_and_writable();
if (r < 0)
return log_error_errno(r, "Failed to check if /proc/sys/fs/binfmt_misc is mounted: %m");
if (r == 0)
return disable_binfmt();
if (argc > optind) {
- r = binfmt_mounted_warn();
+ r = binfmt_mounted_and_writable_warn();
if (r <= 0)
return r;
if (arg_cat_flags != CAT_CONFIG_OFF)
return cat_config(files);
- r = binfmt_mounted_warn();
+ r = binfmt_mounted_and_writable_warn();
if (r <= 0)
return r;
#include "missing_magic.h"
#include "stat-util.h"
-int binfmt_mounted(void) {
+int binfmt_mounted_and_writable(void) {
_cleanup_close_ int fd = -EBADF;
int r;
* We are a bit careful here, since binfmt_misc might still be an autofs which we don't want to
* trigger. */
- r = binfmt_mounted();
+ r = binfmt_mounted_and_writable();
if (r < 0)
return log_warning_errno(r, "Failed to determine whether binfmt_misc is mounted: %m");
if (r == 0) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-int binfmt_mounted(void);
+int binfmt_mounted_and_writable(void);
int disable_binfmt(void);
#include "binfmt-util.h"
#include "tests.h"
-TEST(binfmt_mounted) {
- ASSERT_OK(binfmt_mounted());
+TEST(binfmt_mounted_and_writable) {
+ ASSERT_OK(binfmt_mounted_and_writable());
}
DEFINE_TEST_MAIN(LOG_DEBUG);