daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
b8c242
From fe15b97e44beb69305d3970a3748624ae76f9f04 Mon Sep 17 00:00:00 2001
b8c242
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
b8c242
Date: Wed, 3 Nov 2021 09:39:16 +0100
b8c242
Subject: [PATCH] test-process-util: also add EROFS to the list of "good"
b8c242
 errors
b8c242
b8c242
It is only added in the one place where we actually try to set the
b8c242
setting to a new value. Before we were testing if we can set to it the
b8c242
existing value, which was a noop. We could still get a permission error,
b8c242
but this is the first place where we would propagate EROFS.
b8c242
b8c242
(cherry picked from commit 6434a83d01d96e9f9a17ed9ce1f04a7d64859950)
b8c242
b8c242
Related: #1977569
b8c242
---
b8c242
 src/test/test-procfs-util.c | 2 +-
b8c242
 1 file changed, 1 insertion(+), 1 deletion(-)
b8c242
b8c242
diff --git a/src/test/test-procfs-util.c b/src/test/test-procfs-util.c
b8c242
index bb6943fed0..d656c4df4f 100644
b8c242
--- a/src/test/test-procfs-util.c
b8c242
+++ b/src/test/test-procfs-util.c
b8c242
@@ -53,7 +53,7 @@ int main(int argc, char *argv[]) {
b8c242
 
b8c242
                 r = procfs_tasks_set_limit(v-1);
b8c242
                 log_info_errno(r, "procfs_tasks_set_limit: %m");
b8c242
-                assert_se(r >= 0 || ERRNO_IS_PRIVILEGE(r));
b8c242
+                assert_se(r >= 0 || ERRNO_IS_PRIVILEGE(r) || r == -EROFS);
b8c242
 
b8c242
                 assert_se(procfs_get_threads_max(&w) >= 0);
b8c242
                 assert_se(r >= 0 ? w == v - 1 : w == v);