From 03ce1875647ae063a09fafa978aa6d423d2d1755 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 12 Jan 2009 21:49:42 +0000 Subject: [PATCH] If running with "-K" really do not information about symbols from the a.out argument. Before this fix, after searching the currently-running kernel, we would still search the a.out argument - completely override the in-kernel list, essentially defeating the K flag's purpose. PR: 47387 Submitted by: Ryan Beasley --- usr.bin/gprof/gprof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c index cfb9fab2cc9b..dc9e8a5bb471 100644 --- a/usr.bin/gprof/gprof.c +++ b/usr.bin/gprof/gprof.c @@ -165,7 +165,7 @@ main(argc, argv) * get information from the executable file. */ if ((Kflag && kernel_getnfile(a_outname, &defaultEs) == -1) || - (elf_getnfile(a_outname, &defaultEs) == -1 && + (!Kflag && elf_getnfile(a_outname, &defaultEs) == -1 && aout_getnfile(a_outname, &defaultEs) == -1)) errx(1, "%s: bad format", a_outname); /*