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
This commit is contained in:
+9
-2
@@ -12,6 +12,7 @@
|
|||||||
#include <List.h>
|
#include <List.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *openWith = kTrackerSignature;
|
const char *openWith = kTrackerSignature;
|
||||||
|
int exitcode = EXIT_SUCCESS;
|
||||||
|
|
||||||
char *progName = argv[0];
|
char *progName = argv[0];
|
||||||
if (strrchr(progName, '/'))
|
if (strrchr(progName, '/'))
|
||||||
@@ -55,6 +57,8 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
// subsequent files are open with that app
|
// subsequent files are open with that app
|
||||||
openWith = *argv;
|
openWith = *argv;
|
||||||
|
// clear possible ENOENT from above
|
||||||
|
status = B_OK;
|
||||||
|
|
||||||
// in the case the app is already started,
|
// in the case the app is already started,
|
||||||
// don't start it twice if we have other args
|
// don't start it twice if we have other args
|
||||||
@@ -78,9 +82,12 @@ main(int argc, char **argv)
|
|||||||
} else
|
} else
|
||||||
status = B_ENTRY_NOT_FOUND;
|
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));
|
fprintf(stderr, "%s: \"%s\": %s\n", progName, *argv, strerror(status));
|
||||||
|
// make sure the shell knows this
|
||||||
|
exitcode = EXIT_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return exitcode;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user