nodeinfotest: Print error if cpuinfo file can't be opened

Currently, we are opening the cpuinfo file via fopen() which if fails
doesn't print any error message. We should do that instead.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2014-06-17 13:22:02 +02:00
parent 9571eaaa63
commit 1ad78434c7

View File

@ -39,8 +39,11 @@ linuxTestCompareFiles(const char *cpuinfofile,
goto fail; goto fail;
cpuinfo = fopen(cpuinfofile, "r"); cpuinfo = fopen(cpuinfofile, "r");
if (!cpuinfo) if (!cpuinfo) {
fprintf(stderr, "unable to open: %s : %s\n",
cpuinfofile, strerror(errno));
goto fail; goto fail;
}
memset(&nodeinfo, 0, sizeof(nodeinfo)); memset(&nodeinfo, 0, sizeof(nodeinfo));
if (linuxNodeInfoCPUPopulate(cpuinfo, sysfs_dir, arch, &nodeinfo) < 0) { if (linuxNodeInfoCPUPopulate(cpuinfo, sysfs_dir, arch, &nodeinfo) < 0) {