Skip to content

Commit

Permalink
Merge pull request #41 from eric-ch/oxt-1012
Browse files Browse the repository at this point in the history
OXT-1012: xcpmd: Check for xenstore_ls return value.
  • Loading branch information
rossphilipson authored Apr 6, 2017
2 parents 224684e + 3d04a96 commit b695a5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xcpmd/src/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ static void make_xenstore_battery_dir(unsigned int battery_index) {
bool flag;

dir_entries = xenstore_ls(&num_entries, "/pm");
if (!dir_entries) {
xcpmd_log(LOG_WARNING,
"Listing directory /pm failed with error `%s'\n", strerror(errno));
return;
}

snprintf(xenstore_path, 255, "%s%i", XS_BATTERY_PATH, battery_index);

flag = false;
Expand Down

0 comments on commit b695a5a

Please sign in to comment.