diff options
author | sef <sef@FreeBSD.org> | 1998-09-07 05:49:43 +0000 |
---|---|---|
committer | sef <sef@FreeBSD.org> | 1998-09-07 05:49:43 +0000 |
commit | 82ccb4c63283f0062e12ad38ca46994786ccf094 (patch) | |
tree | c91d459ed444fa503c95411a1b236baa9127dc43 /usr.bin/truss | |
parent | 08c1f13e2ffc07e301441aba6da7b0c49c795d64 (diff) | |
download | FreeBSD-src-82ccb4c63283f0062e12ad38ca46994786ccf094.zip FreeBSD-src-82ccb4c63283f0062e12ad38ca46994786ccf094.tar.gz |
Use a default execution type if none of the listed ones match. This
uses the first type listed in the array as the default type. This isn't
perfect, but I thought it would be better than nothing.
Diffstat (limited to 'usr.bin/truss')
-rw-r--r-- | usr.bin/truss/main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index e5bca66..0cc2aed 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -31,7 +31,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.9 1998/07/06 21:01:47 bde Exp $"; + "$Id: main.c,v 1.10 1998/08/24 10:17:20 cracauer Exp $"; #endif /* not lint */ /* @@ -78,6 +78,10 @@ usage(void) exit(1); } +/* + * WARNING! "FreeBSD a.out" must be first, or set_etype will not + * work correctly. + */ struct ex_types { char *type; void (*enter_syscall)(int, int); @@ -115,6 +119,11 @@ set_etype() { if (!strcmp(funcs->type, progtype)) break; + if (funcs == NULL) { + warn("Execution type %s is not supported -- using FreeBSD a.out\n", + progtype); + funcs = &ex_types[0]; + } return funcs; } |