if (! stdoutLog_.empty()) {
fd = ::open(stdoutLog_.c_str(), O_WRONLY | O_APPEND | O_CREAT, 0666);
if (fd < 0)
- SENF_THROW_SYSTEM_EXCEPTION("")
- << " Could not open \"" << stdoutLog_ << "\" for redirecting stdout.";
+ SENF_THROW_SYSTEM_EXCEPTION(
+ " Could not open \"" + stdoutLog_ + "\" for redirecting stdout.");
stdout_ = fd;
}
if (! stderrLog_.empty()) {
else {
fd = ::open(stdoutLog_.c_str(), O_WRONLY | O_APPEND | O_CREAT, 0666);
if (fd < 0)
- SENF_THROW_SYSTEM_EXCEPTION("")
- << " Could not open \"" << stderrLog_ << "\" for redirecting stderr.";
+ SENF_THROW_SYSTEM_EXCEPTION(
+ " Could not open \"" + stderrLog_ + "\" for redirecting stderr.");
stderr_ = fd;
}
}
{
std::ofstream pidf (tempname.c_str());
if (! pidf)
- SENF_THROW_SYSTEM_EXCEPTION("")
- << " Could not open pidfile \"" << tempname << "\" for output.";
+ SENF_THROW_SYSTEM_EXCEPTION(" Could not open pidfile \"" + tempname + "\" for output.");
pidf << ::getpid() << std::endl;
if (! pidf)
- SENF_THROW_SYSTEM_EXCEPTION("")
- << " Could not write to pidfile \"" << tempname << "\".";
+ SENF_THROW_SYSTEM_EXCEPTION(" Could not write to pidfile \"" + tempname + "\".");
}
if (::link(tempname.c_str(), pidfile_.c_str()) < 0) {
if (errno != EEXIST)
- SENF_THROW_SYSTEM_EXCEPTION("") << linkErrorFormat % pidfile_ % tempname;
+ SENF_THROW_SYSTEM_EXCEPTION((linkErrorFormat % pidfile_ % tempname).str());
}
else {
struct ::stat s;
LIBC_CALL( ::unlink, (tempname.c_str() ));
if (::link(pidfile_.c_str(), tempname.c_str()) < 0) {
if (errno != ENOENT)
- SENF_THROW_SYSTEM_EXCEPTION("") << linkErrorFormat % tempname % pidfile_;
+ SENF_THROW_SYSTEM_EXCEPTION( (linkErrorFormat % tempname % pidfile_).str());
// Hmm ... the pidfile mysteriously disappeared ... try again.
continue;
}