summaryrefslogtreecommitdiff
path: root/x11/ipc/client/ocopclient.cpp
Unidiff
Diffstat (limited to 'x11/ipc/client/ocopclient.cpp') (more/less context) (show whitespace changes)
-rw-r--r--x11/ipc/client/ocopclient.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/x11/ipc/client/ocopclient.cpp b/x11/ipc/client/ocopclient.cpp
index 43e426c..ac6e4a3 100644
--- a/x11/ipc/client/ocopclient.cpp
+++ b/x11/ipc/client/ocopclient.cpp
@@ -5,2 +5,3 @@
5#include <sys/socket.h> 5#include <sys/socket.h>
6#include <sys/types.h>
6#include <sys/un.h> 7#include <sys/un.h>
@@ -18,2 +19,3 @@ OCOPClient::OCOPClient( const QString& path, QObject* obj )
18{ 19{
20 m_tries = 0;
19 init(QFile::encodeName(path) ); 21 init(QFile::encodeName(path) );
@@ -21,5 +23,13 @@ OCOPClient::OCOPClient( const QString& path, QObject* obj )
21OCOPClient::~OCOPClient() { 23OCOPClient::~OCOPClient() {
24 delete m_notify;
22 close( m_socket ); 25 close( m_socket );
23} 26}
27void OCOPClient::init() {
28 // failed start ther server NOW!!!
29 startUP();
30 QCString str;
31 init(str );
32}
24void OCOPClient::init( const QCString& ) { 33void OCOPClient::init( const QCString& ) {
34 m_tries++;
25 struct sockaddr_un unix_adr; 35 struct sockaddr_un unix_adr;
@@ -27,2 +37,3 @@ void OCOPClient::init( const QCString& ) {
27 qWarning("could not socket"); 37 qWarning("could not socket");
38 if ( m_tries < 8 )
28 QTimer::singleShot(400, this,SLOT(init() ) ); 39 QTimer::singleShot(400, this,SLOT(init() ) );
@@ -38,2 +49,3 @@ void OCOPClient::init( const QCString& ) {
38 close( m_socket ); 49 close( m_socket );
50 if ( m_tries < 8 )
39 QTimer::singleShot(400, this, SLOT(init() ) ); 51 QTimer::singleShot(400, this, SLOT(init() ) );
@@ -129 +141,10 @@ void OCOPClient::call( const OCOPPacket& pack ) {
129} 141}
142void OCOPClient::startUP() {
143 qWarning("Start me up");
144 pid_t pi = fork();
145 if ( pi == 0 ) {
146 setsid();
147 execlp("opie-ipc", "opie-ipc", NULL );
148 _exit(1);
149 }
150}