X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fexecute.c;h=55b8bb5bea07820c1f77dd57a5806f413d0dc826;hb=6e41a3e53d858f30e131c62350f51465558ca55c;hp=a0d63a41f9a521b82b806537d4db1e19505da468;hpb=613b411c947635136637f8cdd66b94512f761eab;p=elogind.git diff --git a/src/core/execute.c b/src/core/execute.c index a0d63a41f..55b8bb5be 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -41,6 +41,7 @@ #include #include #include +#undef basename #ifdef HAVE_PAM #include @@ -908,7 +909,7 @@ static void rename_process_from_path(const char *path) { /* This resulting string must fit in 10 chars (i.e. the length * of "/sbin/init") to look pretty in /bin/ps */ - p = path_get_file_name(path); + p = basename(path); if (isempty(p)) { rename_process("(...)"); return; @@ -1197,13 +1198,13 @@ int exec_spawn(ExecCommand *command, goto fail_child; } - err = setup_output(context, STDOUT_FILENO, socket_fd, path_get_file_name(command->path), unit_id, apply_tty_stdin); + err = setup_output(context, STDOUT_FILENO, socket_fd, basename(command->path), unit_id, apply_tty_stdin); if (err < 0) { r = EXIT_STDOUT; goto fail_child; } - err = setup_output(context, STDERR_FILENO, socket_fd, path_get_file_name(command->path), unit_id, apply_tty_stdin); + err = setup_output(context, STDERR_FILENO, socket_fd, basename(command->path), unit_id, apply_tty_stdin); if (err < 0) { r = EXIT_STDERR; goto fail_child;