c3c8da9 "libxl: ao: datacopier callback gets an rc" caused
libxl__domain_save_device_model() to pass its rc directly into the
callback.
However in the preexisting code, there were 3 "goto out;" paths which
left rc uninitialised. This causes a build failure with GCC 4.8's
-Wmaybe-uninitialized.
Set the rc explicitly on each goto out path.
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
dc->readfd = open(filename, O_RDONLY);
if (dc->readfd < 0) {
LOGE(ERROR, "unable to open %s", dc->readwhat);
+ rc = ERROR_FAIL;
goto out;
}
if (fstat(dc->readfd, &st))
{
LOGE(ERROR, "unable to fstat %s", dc->readwhat);
+ rc = ERROR_FAIL;
goto out;
}
if (!S_ISREG(st.st_mode)) {
LOG(ERROR, "%s is not a plain file!", dc->readwhat);
+ rc = ERROR_FAIL;
goto out;
}