Fix some stupidness in ectool's comm_init() handling

ectool was checking for negative return values on comm_init(). It should
have been checking for nonzero. Or comm_init should have been returning
negative. Whatever. The ectool utility was supposed to be a quick-n-dirty
debugging tool, so it's not very well tested.

BUG=chromium:249218
BRANCH=none
TEST=manual

Fired up VM instance, tried old version and new version. Old version
coredumps, new version doesn't.

Change-Id: I0e27d78eead562a16ff826fb80de9e6b07476e12
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58712
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2013-06-14 14:23:31 -07:00
committed by ChromeBot
parent 6a701c5957
commit 7884ae4821

View File

@@ -3096,7 +3096,7 @@ int main(int argc, char *argv[])
exit(1);
}
if (comm_init() < 0) {
if (comm_init()) {
fprintf(stderr, "Couldn't find EC\n");
goto out;
}