mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-14 06:02:31 +00:00
Fixed some compile issues.
This commit is contained in:
+11
-9
@@ -55,17 +55,19 @@ namespace rpc {
|
||||
int
|
||||
ExecFile::execute(const char* file, char* const* argv, int flags) {
|
||||
// Write the execued command and its parameters to the log fd.
|
||||
int __UNUSED result;
|
||||
|
||||
if (m_logFd != -1) {
|
||||
for (char* const* itr = argv; *itr != NULL; itr++) {
|
||||
if (itr == argv)
|
||||
write(m_logFd, "\n---\n", sizeof("\n---\n"));
|
||||
result = write(m_logFd, "\n---\n", sizeof("\n---\n"));
|
||||
else
|
||||
write(m_logFd, " ", 1);
|
||||
result = write(m_logFd, " ", 1);
|
||||
|
||||
write(m_logFd, *itr, std::strlen(*itr));
|
||||
result = write(m_logFd, *itr, std::strlen(*itr));
|
||||
}
|
||||
|
||||
write(m_logFd, "\n---\n", sizeof("\n---\n"));
|
||||
result = write(m_logFd, "\n---\n", sizeof("\n---\n"));
|
||||
}
|
||||
|
||||
int pipeFd[2];
|
||||
@@ -87,7 +89,7 @@ ExecFile::execute(const char* file, char* const* argv, int flags) {
|
||||
|
||||
if (detached_pid != 0) {
|
||||
if (m_logFd != -1)
|
||||
write(m_logFd, "\n--- Background task ---\n", sizeof("\n--- Background task ---\n"));
|
||||
result = write(m_logFd, "\n--- Background task ---\n", sizeof("\n--- Background task ---\n"));
|
||||
|
||||
_exit(0);
|
||||
}
|
||||
@@ -148,8 +150,8 @@ ExecFile::execute(const char* file, char* const* argv, int flags) {
|
||||
::close(pipeFd[0]);
|
||||
|
||||
if (m_logFd != -1) {
|
||||
write(m_logFd, "Captured output:\n", sizeof("Captured output:\n"));
|
||||
write(m_logFd, m_capture.data(), m_capture.length());
|
||||
result = write(m_logFd, "Captured output:\n", sizeof("Captured output:\n"));
|
||||
result = write(m_logFd, m_capture.data(), m_capture.length());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,9 +170,9 @@ ExecFile::execute(const char* file, char* const* argv, int flags) {
|
||||
// Check return value?
|
||||
if (m_logFd != -1) {
|
||||
if (status == 0)
|
||||
write(m_logFd, "\n--- Success ---\n", sizeof("\n--- Success ---\n"));
|
||||
result = write(m_logFd, "\n--- Success ---\n", sizeof("\n--- Success ---\n"));
|
||||
else
|
||||
write(m_logFd, "\n--- Error ---\n", sizeof("\n--- Error ---\n"));
|
||||
result = write(m_logFd, "\n--- Error ---\n", sizeof("\n--- Error ---\n"));
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -177,10 +177,12 @@ SCgiTask::event_read() {
|
||||
worker_thread->poll()->insert_write(this);
|
||||
|
||||
if (m_parent->log_fd() >= 0) {
|
||||
int __UNUSED result;
|
||||
|
||||
// Clean up logging, this is just plain ugly...
|
||||
// write(m_logFd, "\n---\n", sizeof("\n---\n"));
|
||||
write(m_parent->log_fd(), m_buffer, m_bufferSize);
|
||||
write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
||||
result = write(m_parent->log_fd(), m_buffer, m_bufferSize);
|
||||
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
||||
}
|
||||
|
||||
lt_log_print(torrent::LOG_RPC_DEBUG, "---\n%*s\n---", m_bufferSize - std::distance(m_buffer, m_body), m_body);
|
||||
@@ -237,10 +239,11 @@ SCgiTask::receive_write(const char* buffer, uint32_t length) {
|
||||
std::memcpy(m_buffer + headerSize, buffer, length);
|
||||
|
||||
if (m_parent->log_fd() >= 0) {
|
||||
int __UNUSED result;
|
||||
// Clean up logging, this is just plain ugly...
|
||||
// write(m_logFd, "\n---\n", sizeof("\n---\n"));
|
||||
write(m_parent->log_fd(), m_buffer, m_bufferSize);
|
||||
write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
||||
result = write(m_parent->log_fd(), m_buffer, m_bufferSize);
|
||||
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
|
||||
}
|
||||
|
||||
lt_log_print(torrent::LOG_RPC_DEBUG, "---\n%*s\n---", m_bufferSize, m_buffer);
|
||||
|
||||
Reference in New Issue
Block a user