From edeb640ab00e744ad718d9e6f0d588b4f7af3b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 9 Nov 2005 13:46:50 +0000 Subject: [PATCH] discart "File not found" errors for app sigs; make sure the shell gets any error git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14788 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/open.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bin/open.cpp b/src/bin/open.cpp index 74f3f19f26..af3d3398a5 100644 --- a/src/bin/open.cpp +++ b/src/bin/open.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -23,6 +24,7 @@ int main(int argc, char **argv) { const char *openWith = kTrackerSignature; + int exitcode = EXIT_SUCCESS; char *progName = argv[0]; if (strrchr(progName, '/')) @@ -55,6 +57,8 @@ main(int argc, char **argv) // subsequent files are open with that app openWith = *argv; + // clear possible ENOENT from above + status = B_OK; // in the case the app is already started, // don't start it twice if we have other args @@ -78,9 +82,12 @@ main(int argc, char **argv) } else status = B_ENTRY_NOT_FOUND; - if (status != B_OK && status != B_ALREADY_RUNNING) + if (status != B_OK && status != B_ALREADY_RUNNING) { fprintf(stderr, "%s: \"%s\": %s\n", progName, *argv, strerror(status)); + // make sure the shell knows this + exitcode = EXIT_FAILURE; + } } - return 0; + return exitcode; }