aboutsummaryrefslogtreecommitdiff
path: root/src/cgls
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-17 11:17:38 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-17 11:17:38 +0100
commitd72495759b0f953b86f16669bf8120ede28836a5 (patch)
treeeacd34debbc87ef5838ad5cd36a8c637d2be68d1 /src/cgls
parentpath-util: introduce new safe_getcwd() wrapper (diff)
downloadsystemd-d72495759b0f953b86f16669bf8120ede28836a5.tar.gz
systemd-d72495759b0f953b86f16669bf8120ede28836a5.tar.bz2
systemd-d72495759b0f953b86f16669bf8120ede28836a5.zip
tree-wide: port all code to use safe_getcwd()
Diffstat (limited to 'src/cgls')
-rw-r--r--src/cgls/cgls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
index fb44b9f66..bd8c6a005 100644
--- a/src/cgls/cgls.c
+++ b/src/cgls/cgls.c
@@ -277,9 +277,9 @@ int main(int argc, char *argv[]) {
if (!arg_machine) {
_cleanup_free_ char *cwd = NULL;
- cwd = get_current_dir_name();
- if (!cwd) {
- r = log_error_errno(errno, "Cannot determine current working directory: %m");
+ r = safe_getcwd(&cwd);
+ if (r < 0) {
+ log_error_errno(r, "Cannot determine current working directory: %m");
goto finish;
}