Loading Makefile +4 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,9 @@ OPTIMIZE = -O3 KINETIC_HOST1 ?= localhost SESSION_HMAC_KEY ?= asdfasdf SESSION_PIN ?= 1234 WARN = -Wall -Wextra -Werror -Wstrict-prototypes -Wcast-align -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes WARN = -Wall -Wextra -Wstrict-prototypes -Wcast-align -pedantic WARN += -Wno-missing-field-initializers -Werror=strict-prototypes -Wshadow WARN += -Werror CDEFS += -D_POSIX_C_SOURCE=199309L -D_C99_SOURCE=1 CFLAGS += -std=c99 -fPIC -g $(WARN) $(CDEFS) $(OPTIMIZE) LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lcrypto -lssl -lpthread -ljson-c Loading Loading @@ -143,7 +145,7 @@ ${OUT_DIR}/%.o: ${LIB_DIR}/%.c Makefile ${PUB_INC}/%.h Makefile # Sources with atypical paths / dependencies $(OUT_DIR)/socket99.o: $(SOCKET99)/socket99.c $(SOCKET99)/socket99.h $(CC) -c -o $@ $< $(CFLAGS) -I$(SOCKET99) $(CC) -c -o $@ $< $(CFLAGS) -Wno-shadow -I$(SOCKET99) $(OUT_DIR)/protobuf-c.o: $(PROTOBUFC)/protobuf-c/protobuf-c.c $(PROTOBUFC)/protobuf-c/protobuf-c.h $(CC) -c -o $@ $< -std=c99 -fPIC -g -Wall -Werror -Wno-unused-parameter $(OPTIMIZE) -I$(PROTOBUFC) ${OUT_DIR}/kinetic_types.o: ${LIB_DIR}/kinetic_types_internal.h Loading include/kinetic_client.h +11 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,17 @@ KineticStatus KineticClient_CreateSession(KineticSessionConfig * const config, */ KineticStatus KineticClient_DestroySession(KineticSession * const session); /** * @brief Returns the reason reported in the case of the Kinetic device * terminating a session in the case of a catastrophic error occurring. * * @param session The KineticSession to query. * * @return Returns the status reported prior to termination * or KINTEIC_STATUS_SUCCESS if not terminated. */ KineticStatus KineticClient_GetTerminationStatus(KineticSession * const session); /** * @brief Executes a `NOOP` operation to test whether the Kinetic Device is operational. * Loading include/kinetic_types.h +2 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,8 @@ typedef enum { KINETIC_STATUS_REQUEST_REJECTED, ///< No request was attempted. KINETIC_STATUS_DEVICE_NAME_REQUIRED, ///< A device name is required, but was empty KINETIC_STATUS_INVALID_LOG_TYPE, ///< The device log type specified was invalid KINETIC_STATUS_HMAC_FAILURE, ///< An HMAC validation error was detected KINETIC_STATUS_SESSION_TERMINATED, ///< The session has been terminated by the Kinetic device KINETIC_STATUS_COUNT ///< Number of status codes in KineticStatusDescriptor } KineticStatus; Loading src/lib/bus/bus.c +1 −0 Original line number Diff line number Diff line Loading @@ -440,6 +440,7 @@ bool bus_release_socket(struct bus *b, int fd, void **socket_udata_out) { return false; /* couldn't send msg to listener */ } assert(completion_pipe != -1); bool completed = bus_poll_on_completion(b, completion_pipe); if (!completed) { /* listener hung up while waiting */ return false; Loading src/lib/bus/bus_poll.c +4 −0 Original line number Diff line number Diff line Loading @@ -45,7 +45,11 @@ bool bus_poll_on_completion(struct bus *b, int fd) { #ifdef TEST errno = poll_errno; #endif BUS_LOG_SNPRINTF(b, 5, LOG_SENDING_REQUEST, b->udata, 64, "poll_on_completion, polling %d", fd); int res = syscall_poll(fds, 1, -1); BUS_LOG_SNPRINTF(b, 5, LOG_SENDING_REQUEST, b->udata, 64, "poll_on_completion for %d, res %d (errno %d)", fd, res, errno); if (res == -1) { if (util_is_resumable_io_error(errno)) { BUS_LOG_SNPRINTF(b, 5, LOG_SENDING_REQUEST, b->udata, 64, Loading Loading
Makefile +4 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,9 @@ OPTIMIZE = -O3 KINETIC_HOST1 ?= localhost SESSION_HMAC_KEY ?= asdfasdf SESSION_PIN ?= 1234 WARN = -Wall -Wextra -Werror -Wstrict-prototypes -Wcast-align -pedantic -Wno-missing-field-initializers -Werror=strict-prototypes WARN = -Wall -Wextra -Wstrict-prototypes -Wcast-align -pedantic WARN += -Wno-missing-field-initializers -Werror=strict-prototypes -Wshadow WARN += -Werror CDEFS += -D_POSIX_C_SOURCE=199309L -D_C99_SOURCE=1 CFLAGS += -std=c99 -fPIC -g $(WARN) $(CDEFS) $(OPTIMIZE) LDFLAGS += -lm -L${OPENSSL_PATH}/lib -lcrypto -lssl -lpthread -ljson-c Loading Loading @@ -143,7 +145,7 @@ ${OUT_DIR}/%.o: ${LIB_DIR}/%.c Makefile ${PUB_INC}/%.h Makefile # Sources with atypical paths / dependencies $(OUT_DIR)/socket99.o: $(SOCKET99)/socket99.c $(SOCKET99)/socket99.h $(CC) -c -o $@ $< $(CFLAGS) -I$(SOCKET99) $(CC) -c -o $@ $< $(CFLAGS) -Wno-shadow -I$(SOCKET99) $(OUT_DIR)/protobuf-c.o: $(PROTOBUFC)/protobuf-c/protobuf-c.c $(PROTOBUFC)/protobuf-c/protobuf-c.h $(CC) -c -o $@ $< -std=c99 -fPIC -g -Wall -Werror -Wno-unused-parameter $(OPTIMIZE) -I$(PROTOBUFC) ${OUT_DIR}/kinetic_types.o: ${LIB_DIR}/kinetic_types_internal.h Loading
include/kinetic_client.h +11 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,17 @@ KineticStatus KineticClient_CreateSession(KineticSessionConfig * const config, */ KineticStatus KineticClient_DestroySession(KineticSession * const session); /** * @brief Returns the reason reported in the case of the Kinetic device * terminating a session in the case of a catastrophic error occurring. * * @param session The KineticSession to query. * * @return Returns the status reported prior to termination * or KINTEIC_STATUS_SUCCESS if not terminated. */ KineticStatus KineticClient_GetTerminationStatus(KineticSession * const session); /** * @brief Executes a `NOOP` operation to test whether the Kinetic Device is operational. * Loading
include/kinetic_types.h +2 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,8 @@ typedef enum { KINETIC_STATUS_REQUEST_REJECTED, ///< No request was attempted. KINETIC_STATUS_DEVICE_NAME_REQUIRED, ///< A device name is required, but was empty KINETIC_STATUS_INVALID_LOG_TYPE, ///< The device log type specified was invalid KINETIC_STATUS_HMAC_FAILURE, ///< An HMAC validation error was detected KINETIC_STATUS_SESSION_TERMINATED, ///< The session has been terminated by the Kinetic device KINETIC_STATUS_COUNT ///< Number of status codes in KineticStatusDescriptor } KineticStatus; Loading
src/lib/bus/bus.c +1 −0 Original line number Diff line number Diff line Loading @@ -440,6 +440,7 @@ bool bus_release_socket(struct bus *b, int fd, void **socket_udata_out) { return false; /* couldn't send msg to listener */ } assert(completion_pipe != -1); bool completed = bus_poll_on_completion(b, completion_pipe); if (!completed) { /* listener hung up while waiting */ return false; Loading
src/lib/bus/bus_poll.c +4 −0 Original line number Diff line number Diff line Loading @@ -45,7 +45,11 @@ bool bus_poll_on_completion(struct bus *b, int fd) { #ifdef TEST errno = poll_errno; #endif BUS_LOG_SNPRINTF(b, 5, LOG_SENDING_REQUEST, b->udata, 64, "poll_on_completion, polling %d", fd); int res = syscall_poll(fds, 1, -1); BUS_LOG_SNPRINTF(b, 5, LOG_SENDING_REQUEST, b->udata, 64, "poll_on_completion for %d, res %d (errno %d)", fd, res, errno); if (res == -1) { if (util_is_resumable_io_error(errno)) { BUS_LOG_SNPRINTF(b, 5, LOG_SENDING_REQUEST, b->udata, 64, Loading