libkni3/kni-3.9.2-noexit.patch

58 lines
2.4 KiB
Diff
Raw Normal View History

2009-09-14 22:25:05 +00:00
diff -urN KNI_3.9.2.patched/src/Base/cdlSocket.cpp KNI_3.9.2.noexit/src/Base/cdlSocket.cpp
--- KNI_3.9.2.patched/src/Base/cdlSocket.cpp 2008-12-01 13:12:13.000000000 +0100
+++ KNI_3.9.2.noexit/src/Base/cdlSocket.cpp 2008-12-01 13:16:07.000000000 +0100
@@ -23,6 +23,7 @@
#include <iostream>
#include <cstring>
#include <cstdlib>
+#include <stdexcept>
/****************************************************************************/
//test write:
@@ -95,7 +96,7 @@
_socketfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if(_socketfd == -1){
std::cout << "socket could not be created"<<_ipAddr<<" port: "<< _port<<" \n";
- exit(1);
+ throw std::runtime_error("socket could not be created");
}
memset(&_socketAddr, 0, sizeof(_socketAddr));
_socketAddr.sin_family = AF_INET;
@@ -106,13 +107,13 @@
res = inet_pton ( AF_INET, _ipAddr, &_socketAddr.sin_addr );
if ( errno == EAFNOSUPPORT ){
std::cout << "inet_pton failed, try again "<<_ipAddr<<" port: "<< _port<<" \n";
- exit(1);
+ throw std::runtime_error("inet_pton failed (EAFNOSUPPORT)");
}
// std::cout << "trying to connect to server...\n";
res = connect(_socketfd, (struct sockaddr *) &_socketAddr, _len);
if(res != 0){
std::cout << "client could not connect, check if server is running on ip "<<_ipAddr<<" port: "<< _port<<" \n";
- exit(1);
+ throw std::runtime_error("client could not connect, check if server is running");
}
else{
// std::cout << "client connected to ip "<<_ipAddr<<", port: "<< _port<<" \n";
diff -urN KNI_3.9.2.patched/src/Base/kmlExt.cpp KNI_3.9.2.noexit/src/Base/kmlExt.cpp
--- KNI_3.9.2.patched/src/Base/kmlExt.cpp 2007-09-28 07:38:10.000000000 +0200
+++ KNI_3.9.2.noexit/src/Base/kmlExt.cpp 2008-12-01 13:16:58.000000000 +0100
@@ -28,6 +28,7 @@
#include <iostream>
#include <algorithm>
#include <vector>
+#include <stdexcept>
#define max(a,b) (((a)>(b))?(a):(b))
KNI::Timer kni_timer;
@@ -145,7 +146,8 @@
std::cout << "Exit: Incompatible Config File!\n";
std::cout << "Check whether you have a Katana 400 or 300 and choose the config file accordingly\n";
std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.";
- exit(0);
+ throw std::runtime_error("Exit: Incompatible Config File! "
+ "Check whether you have a Katana 400 or 300 and choose the config file accordingly");
}
bool gripperIsPresent;
int gripperOpenEncoders, gripperCloseEncoders;