diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-01-17 11:17:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-17 11:17:38 +0100 |
commit | d72495759b0f953b86f16669bf8120ede28836a5 (patch) | |
tree | eacd34debbc87ef5838ad5cd36a8c637d2be68d1 /src/cgls | |
parent | path-util: introduce new safe_getcwd() wrapper (diff) | |
download | systemd-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.c | 6 |
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; } |