]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: rename save_context() → context_parse_iovw()
authorLennart Poettering <lennart@poettering.net>
Thu, 31 Oct 2024 14:15:33 +0000 (15:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 Oct 2024 22:08:11 +0000 (23:08 +0100)
The function doesn't "save" anything, it just parses iovw into the
individual fields, hence name the function accordingly.

src/coredump/coredump.c

index 6d556a7a1f65b2443d5ad4a9e5a657604750b00c..9b12c25cbdfd8e81a861e6c8efd287677ec52734 100644 (file)
@@ -1016,7 +1016,7 @@ static int submit_coredump(
         return 0;
 }
 
-static int save_context(Context *context, const struct iovec_wrapper *iovw) {
+static int context_parse_iovw(Context *context, const struct iovec_wrapper *iovw) {
         const char *unit;
         int r;
 
@@ -1214,7 +1214,7 @@ static int process_socket(int fd) {
         /* Make sure we got all data we really need */
         assert(input_fd >= 0);
 
-        r = save_context(&context, &iovw);
+        r = context_parse_iovw(&context, &iovw);
         if (r < 0)
                 goto finish;
 
@@ -1365,7 +1365,7 @@ static int gather_pid_metadata_from_argv(
 
         /* Cache some of the process metadata we collected so far and that we'll need to
          * access soon */
-        return save_context(context, iovw);
+        return context_parse_iovw(context, iovw);
 }
 
 static int gather_pid_metadata_from_procfs(struct iovec_wrapper *iovw, Context *context) {
@@ -1452,7 +1452,7 @@ static int gather_pid_metadata_from_procfs(struct iovec_wrapper *iovw, Context *
         if (read_full_virtual_file(p, &t, &size) >= 0) {
                 char *buf = malloc(strlen("COREDUMP_PROC_AUXV=") + size + 1);
                 if (buf) {
-                        /* Add a dummy terminator to make save_context() happy. */
+                        /* Add a dummy terminator to make context_parse_iovw() happy. */
                         *mempcpy_typesafe(stpcpy(buf, "COREDUMP_PROC_AUXV="), t, size) = '\0';
                         (void) iovw_consume(iovw, buf, size + strlen("COREDUMP_PROC_AUXV="));
                 }
@@ -1480,7 +1480,7 @@ static int gather_pid_metadata_from_procfs(struct iovec_wrapper *iovw, Context *
                 (void) iovw_put_string_field_free(iovw, "COREDUMP_ENVIRON=", t);
 
         /* we successfully acquired all metadata */
-        return save_context(context, iovw);
+        return context_parse_iovw(context, iovw);
 }
 
 static int send_ucred(int transport_fd, const struct ucred *ucred) {
@@ -1677,7 +1677,7 @@ static int forward_coredump_to_container(Context *context) {
                 }
 
                 _cleanup_(context_done) Context child_context = CONTEXT_NULL;
-                r = save_context(&child_context, iovw);
+                r = context_parse_iovw(&child_context, iovw);
                 if (r < 0) {
                         log_debug_errno(r, "Failed to save context: %m");
                         _exit(EXIT_FAILURE);