LogInfo("Step: installation for osp service");
std::ostringstream commStr;
- commStr << OSP_INSTALL_STR << BashUtils::escape_arg(m_context.locations->getPackageInstallationDir());
+ commStr << OSP_INSTALL_STR << BashUtils::escape_arg(
+ m_context.locations->getPackageInstallationDir());
//commStr << " 2>&1";
LogDebug("osp install command : " << commStr.str());
fd = popen(commStr.str().c_str(), "r");
if (NULL == fd) {
LogError("Failed to installtion osp service");
- ThrowMsg(Exceptions::InstallOspsvcFailed, "Error occurs during\
+ ThrowMsg(Exceptions::InstallOspsvcFailed,
+ "Error occurs during\
+ install osp service");
+ }
+
+ if (fgets(readBuf, MAX_BUF_SIZE, fd) == NULL)
+ {
+ LogError("Failed to installtion osp service.\
+ Inability of reading file.");
+ ThrowMsg(Exceptions::InstallOspsvcFailed,
+ "Error occurs during\
install osp service");
}
- fgets(readBuf, MAX_BUF_SIZE, fd);
LogDebug("return value : " << readBuf);
int result = atoi(readBuf);
if (0 != result) {
- ThrowMsg(Exceptions::InstallOspsvcFailed, "Error occurs during\
+ ThrowMsg(Exceptions::InstallOspsvcFailed,
+ "Error occurs during\
install osp service");
}