From da78f6bf20cee419602b069178e8896079fb8b77 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Sat, 25 Mar 2023 12:31:44 +1300 Subject: [PATCH] open: B_ALREADY_RUNNING is valid for BUrl::OpenWithPreferredApplication(). Caused `open` to display an error with non-zero exit code when the target application was already running and is single launch. In fact, the error check at the end explicitly tests for B_ALREADY_RUNNING along with B_OK. Change-Id: Ic38c961bcdd8350b97b0d75ec010d25198afd561 --- src/bin/open.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/open.cpp b/src/bin/open.cpp index 02aaa6565e..575872be7c 100644 --- a/src/bin/open.cpp +++ b/src/bin/open.cpp @@ -97,8 +97,8 @@ main(int argc, char** argv) } else if (strchr(*argv, ':')) { // try to open it as an URI BUrl url(*argv); - if (url.OpenWithPreferredApplication() == B_OK) { - result = B_OK; + result = url.OpenWithPreferredApplication(); + if (result == B_OK || result == B_ALREADY_RUNNING) continue; }