From 1295c9066a490bee60c2921b798911326a468eb8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 10 Oct 2018 17:44:43 +0200 Subject: [PATCH] import: prefer fd_get_path() over readlink_malloc() where applicable --- src/import/export.c | 4 ++-- src/import/import.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/import/export.c b/src/import/export.c index f81485bbc7..490710678f 100644 --- a/src/import/export.c +++ b/src/import/export.c @@ -95,7 +95,7 @@ static int export_tar(int argc, char *argv[], void *userdata) { fd = STDOUT_FILENO; - (void) readlink_malloc("/proc/self/fd/1", &pretty); + (void) fd_get_path(fd, &pretty); log_info("Exporting '%s', saving to '%s' with compression '%s'.", local, strna(pretty), import_compress_type_to_string(arg_compress)); } @@ -172,7 +172,7 @@ static int export_raw(int argc, char *argv[], void *userdata) { fd = STDOUT_FILENO; - (void) readlink_malloc("/proc/self/fd/1", &pretty); + (void) fd_get_path(fd, &pretty); log_info("Exporting '%s', saving to '%s' with compression '%s'.", local, strna(pretty), import_compress_type_to_string(arg_compress)); } diff --git a/src/import/import.c b/src/import/import.c index 9dca2f3d41..f34244acff 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -96,7 +96,7 @@ static int import_tar(int argc, char *argv[], void *userdata) { fd = STDIN_FILENO; - (void) readlink_malloc("/proc/self/fd/0", &pretty); + (void) fd_get_path(fd, &pretty); log_info("Importing '%s', saving as '%s'.", strna(pretty), local); } @@ -192,7 +192,7 @@ static int import_raw(int argc, char *argv[], void *userdata) { fd = STDIN_FILENO; - (void) readlink_malloc("/proc/self/fd/0", &pretty); + (void) fd_get_path(fd, &pretty); log_info("Importing '%s', saving as '%s'.", strempty(pretty), local); }