summaryrefslogtreecommitdiffabout
path: root/src/eyefiworker.cc
authorMichael Krelin <hacker@klever.net>2012-01-20 20:46:30 (UTC)
committer Michael Krelin <hacker@klever.net>2012-01-20 20:46:30 (UTC)
commit62d09cb2346588773a9e25ac9e9a942816b8581a (patch) (side-by-side diff)
tree791221bad465ac702a481490d5fdab0a96b6e185 /src/eyefiworker.cc
parenta9f093cc83926b0e83324aa9e022903563d9d801 (diff)
downloadiii-62d09cb2346588773a9e25ac9e9a942816b8581a.zip
iii-62d09cb2346588773a9e25ac9e9a942816b8581a.tar.gz
iii-62d09cb2346588773a9e25ac9e9a942816b8581a.tar.bz2
minor but numerous changes from compiler-happiness department
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'src/eyefiworker.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--src/eyefiworker.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/eyefiworker.cc b/src/eyefiworker.cc
index 2d7827c..c051482 100644
--- a/src/eyefiworker.cc
+++ b/src/eyefiworker.cc
@@ -1,36 +1,36 @@
#include <signal.h>
#include <stdexcept>
#include "eyefiworker.h"
eyefiworker::eyefiworker()
: eyefiService(SOAP_IO_STORE|SOAP_IO_KEEPALIVE) {
bind_flags = SO_REUSEADDR; max_keep_alive = 0;
socket_flags =
#if defined(MSG_NOSIGNAL)
MSG_NOSIGNAL
#elif defined(SO_NOSIGPIPE)
SO_NOSIGPIPE
#else
#error Something is wrong with sigpipe prevention on the platform
#endif
;
}
-int eyefiworker::run(int port) {
- if(!soap_valid_socket(bind(0,port,64)))
+int eyefiworker::run(int bindport) {
+ if(!soap_valid_socket(bind(0,bindport,64)))
throw std::runtime_error("failed to bind()");
signal(SIGCHLD,SIG_IGN);
while(true) {
if(!soap_valid_socket(accept()))
throw std::runtime_error("failed to accept()");
pid_t p = fork();
if(p<0) throw std::runtime_error("failed to fork()");
if(!p) {
recv_timeout = 600; send_timeout = 120;
(void)serve();
soap_destroy(this); soap_end(this); soap_done(this);
_exit(0);
}
close(socket); socket = SOAP_INVALID_SOCKET;
}
}