#include "serialcomm.h"
#include "packetbuffer.h"
+#ifdef __APPLE__
+#include <unistd.h>
+#include <signal.h>
+#endif
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();
const char* buffer = message.c_str();
while (length > 0)
{
+#ifdef __APPLE__
+ int n = send(clientFD, buffer, length, 0);
+#else
int n = send(clientFD, buffer, length, MSG_NOSIGNAL);
+#endif
if (!(n > 0))
{
return false;
int actual = 0;
while (count > 0)
{
+#ifdef __APPLE__
+ int n = send(fd, buffer, count, 0);
+#else
int n = send(fd, buffer, count, MSG_NOSIGNAL);
+#endif
if (n == -1)
{
return -1;