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
This commit is contained in:
Jessica Hamilton
2023-03-25 12:47:43 +13:00
parent 90d34dcaf0
commit da78f6bf20
+2 -2
View File
@@ -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;
}