summaryrefslogtreecommitdiff
path: root/sys-process/procps/files/procps-4.0.5-sysctl-ignore_failure.patch
blob: 393da09f853ec0faa4415c6f5d3fb6ee537ce36a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Don't error for close_stream failure if the config line begins with "-"
https://bugs.gentoo.org/969014
https://gitlab.com/procps-ng/procps/-/issues/410

--- procps-ng-4.0.5/src/sysctl.c
+++ procps-ng-4.0.5/src/sysctl.c
@@ -623,9 +623,12 @@ static int WriteSetting(
             if (0 < fprintf(fp, "%s\n", value))
                 rc = EXIT_SUCCESS;
             if (close_stream(fp) != 0) {
-                xwarn(_("setting key \"%s\""), dotted_key);
+                xwarn(_("setting key \"%s\"%s"),
+                      dotted_key, (ignore_failure?_(", ignoring"):""));
 		free(dotted_key);
-                return EXIT_FAILURE;
+                if (!ignore_failure)
+                    rc = EXIT_FAILURE;
+                return rc;
             }
         }
     }