]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - support/sdk/cpp/sf/sf.cpp
try to circumvent Mac OS X problems
[tinyos-2.x.git] / support / sdk / cpp / sf / sf.cpp
index fdf5ced473a7b001eb16346a6440cd2b3c39d2c1..c5adcb13ea4638fee8f54572d8a671a7aff6ff6b 100644 (file)
 #include "serialcomm.h"
 #include "packetbuffer.h"
 
+#ifdef __APPLE__
+#include <unistd.h>
+#include <signal.h>
+#endif
 
 using namespace std;
 
@@ -54,6 +58,11 @@ using namespace std;
 int main(int argc, char *argv[])
 {
 
+#ifdef __APPLE__
+    if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
+        cerr << "Warning: failed to ignore SIGPIPE " << endl;
+#endif
+    
   SFControl control;
   control.parseArgs(argc, argv);
   control.waitOnInput();