vpd: Fix dump_vpd_log failure on first run.

dump_vpd_log aborts if the cache dir doesn't exist at the time temp files are
created.  Fixed by moving cache dir creation ahead of temp file creation.

And a couple of minor fixes/improvments.

BUG=chromium:379090, chromium:436056
TEST=manual test passed
TEST=buildbot amd64-generic-full passed

Change-Id: I1bab0695a473f3596c0714b0d9d1cc1b981b1fa6
Reviewed-on: https://chromium-review.googlesource.com/231334
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Tested-by: Thiemo Nagel <tnagel@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Thiemo Nagel <tnagel@chromium.org>
1 file changed
tree: 4e276371d6c0a78f83974f98b313a39aac95c8f3
  1. include/
  2. init/
  3. lib/
  4. tests/
  5. util/
  6. LICENSE
  7. Makefile
  8. OWNERS
  9. README
  10. vpd.c