commit fa244dd0822266d0e6943fb9e7f5fefc19aa522c
parent d8ffa8afb7819a19505e8869a0aee8a8874a21c3
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Sat, 12 Mar 2016 19:30:09 -0700
lib: compile runtime with -std=c89
Diffstat:
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
@@ -1,7 +1,7 @@
LIB = scv
SRCS = runtime.c
-CFLAGS += -pthread -I../
+CFLAGS += -std=c89 -pthread -I../
NOPROFILE = 1
.include <bsd.lib.mk>
diff --git a/lib/runtime.c b/lib/runtime.c
@@ -2,8 +2,8 @@
#include <pthread.h>
#include <stdio.h>
#include <string.h>
-#include <sys/socket.h> // AF_UNIX
-#include <sys/un.h> // sockaddr_un
+#include <sys/socket.h>
+#include <sys/un.h>
#include <scv_global.h>
@@ -81,11 +81,11 @@ walk_nodes(int fd)
}
int
-xwrite(int d, const void *buf, size_t bytes_total)
+xwrite(int d, const uint8_t *buf, size_t bytes_total)
{
- ssize_t n;
int bytes_left = bytes_total;
int bytes_wrote = 0;
+ ssize_t n;
while (bytes_left > 0) {
n = write(d, buf + bytes_wrote, bytes_left);
@@ -101,11 +101,11 @@ xwrite(int d, const void *buf, size_t bytes_total)
}
int
-xread(int d, void *buf, size_t bytes_total)
+xread(int d, uint8_t *buf, size_t bytes_total)
{
- ssize_t n;
ssize_t bytes_left = bytes_total;
size_t bytes_read = 0;
+ ssize_t n;
while (bytes_left > 0) {
n = read(d, buf + bytes_read, bytes_left);