kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 0c21c08b6d2008b09c45d0f040fd2976128362f2
parent a2a87adf197cba64703e2c30503a2641a3f7e2f1
Author: Joris Vink <joris@coders.se>
Date:   Fri,  1 Aug 2014 10:46:50 +0200

Hook orbit into the build

Diffstat:
Makefile | 22+++++++++++++++-------
src/orbit.c | 6+++---
2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,21 +1,26 @@ # Kore Makefile CC=gcc -BIN=kore +KORE=kore +ORBIT=orbit INSTALL_DIR=/usr/local/bin INCLUDE_DIR=/usr/local/include/kore -S_SRC+= src/kore.c src/accesslog.c src/auth.c src/buf.c src/config.c \ +S_SRC= src/kore.c src/accesslog.c src/auth.c src/buf.c src/config.c \ src/connection.c src/domain.c src/http.c src/mem.c src/module.c \ src/net.c src/pool.c src/spdy.c src/validator.c src/utils.c \ src/worker.c src/zlib_dict.c S_OBJS= $(S_SRC:.c=.o) +O_SRC= src/orbit.c + CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual CFLAGS+=-Wsign-compare -Iincludes -g LDFLAGS+=-rdynamic -lssl -lcrypto -lz +ORBIT_CFLAGS=$(CFLAGS) + ifneq ("$(DEBUG)", "") CFLAGS+=-DKORE_DEBUG endif @@ -54,16 +59,19 @@ else S_SRC+=src/bsd.c endif -all: $(S_OBJS) - $(CC) $(CFLAGS) $(S_OBJS) $(LDFLAGS) -o $(BIN) +all: $(S_OBJS) $(O_SRC) + $(CC) $(ORBIT_CFLAGS) $(O_SRC) -o $(ORBIT) + $(CC) $(LDFLAGS) $(S_OBJS) -o $(KORE) install: mkdir -p $(INCLUDE_DIR) - install -m 555 $(BIN) $(INSTALL_DIR)/$(BIN) + install -m 555 $(KORE) $(INSTALL_DIR)/$(KORE) + install -m 555 $(ORBIT) $(INSTALL_DIR)/$(ORBIT) install -m 644 includes/*.h $(INCLUDE_DIR) uninstall: - rm -f $(INSTALL_DIR)/$(BIN) + rm -f $(INSTALL_DIR)/$(KORE) + rm -f $(INSTALL_DIR)/$(ORBIT) rm -rf $(INCLUDE_DIR) .c.o: @@ -71,6 +79,6 @@ uninstall: clean: find . -type f -name \*.o -exec rm {} \; - rm -f $(BIN) + rm -f $(KORE) $(ORBIT) .PHONY: clean diff --git a/src/orbit.c b/src/orbit.c @@ -14,8 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _GNU_SOURCE - #include <sys/param.h> #include <sys/stat.h> #include <sys/queue.h> @@ -318,11 +316,13 @@ static void orbit_file_write(int fd, const void *buf, size_t len) { ssize_t r; + const u_int8_t *d; size_t written; + d = buf; written = 0; while (written != len) { - r = write(fd, buf + written, len - written); + r = write(fd, d + written, len - written); if (r == -1) { if (errno == EINTR) continue;