This prevents the compilation warning:
ncb.c: In function 'main':
ncb.c:32: warning: ignoring return value of ‘write’, declared with
attribute warn_unused_result
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
+#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
len = recvfrom (s, buf, sizeof buf, 0, (struct sockaddr *) &addr, &addr_len);
if (len < 0)
break;
- write (1, buf, len);
+ if (write (1, buf, len) != len)
+ fprintf(stderr, "WARNING: serial characters dropped\n");
}
return 0;