Skip to content

Commit

Permalink
Allow compilation on recent versions of FreeBSD, which have libexecin…
Browse files Browse the repository at this point in the history
…fo in the base system but return size_t instead of int for backtrace()

This is part of making GN bootstrap on FreeBSD.

Tested on FreeBSD 8.4-i386 and FreeBSD 10.0-amd64

BUG=

Review URL: https://codereview.chromium.org/178193018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256484 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
r.c.ladan@gmail.com committed Mar 12, 2014
1 parent 08f2c54 commit 82933a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/debug/stack_trace_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "base/debug/debugger.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/string_number_conversions.h"

Expand Down Expand Up @@ -472,7 +473,7 @@ StackTrace::StackTrace() {

// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
count_ = std::max(backtrace(trace_, arraysize(trace_)), 0);
count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
}

void StackTrace::Print() const {
Expand Down

0 comments on commit 82933a5

Please sign in to comment.