summaryrefslogtreecommitdiffstats
path: root/src/coredump
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-10-31 15:15:33 +0100
committerLennart Poettering <lennart@poettering.net>2024-10-31 23:08:11 +0100
commit32756e57ef2f19f353810a87ed9c350e5950fce5 (patch)
treec44acd6a1df18bb6dc3f6aed93cb66c7c64b3cbe /src/coredump
parentcoredump: acquire some process fields via pidref (diff)
downloadsystemd-32756e57ef2f19f353810a87ed9c350e5950fce5.tar.xz
systemd-32756e57ef2f19f353810a87ed9c350e5950fce5.zip
coredump: rename save_context() → context_parse_iovw()
The function doesn't "save" anything, it just parses iovw into the individual fields, hence name the function accordingly.
Diffstat (limited to 'src/coredump')
-rw-r--r--src/coredump/coredump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
index 6d556a7a1f..9b12c25cbd 100644
--- a/src/coredump/coredump.c
+++ b/src/coredump/coredump.c
@@ -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);