]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: log about osc_context_open_chpriv() failure
authorMike Yuan <me@yhndnzj.com>
Sun, 2 Mar 2025 13:45:28 +0000 (14:45 +0100)
committerMike Yuan <me@yhndnzj.com>
Sun, 2 Mar 2025 15:21:59 +0000 (16:21 +0100)
Follow-up for 575922c914c732bb77c99aee54c84dc365d60631

src/run/run.c

index 816fd8dd9a4cfc8ce63be09ed7bc3cb717ead82c..21d7a94e29fd2de4e7118f878900a05253bd1a7d 100644 (file)
@@ -2205,10 +2205,10 @@ static int start_transient_service(sd_bus *bus) {
 
                 _cleanup_(osc_context_closep) sd_id128_t osc_context_id = SD_ID128_NULL;
                 if (pty_fd >= 0) {
-                        if (!terminal_is_dumb() && arg_exec_user) {
+                        if (arg_exec_user && !terminal_is_dumb()) {
                                 r = osc_context_open_chpriv(arg_exec_user, /* ret_seq= */ NULL, &osc_context_id);
                                 if (r < 0)
-                                        return r;
+                                        return log_error_errno(r, "Failed to set OSC context: %m");
                         }
 
                         (void) sd_event_set_signal_exit(c.event, true);