Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/initfail.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
int
main(int argc, char **argv)
{
argc = argc;
argv = argv;
(void) argc;
(void) argv;
return 1;
}
11 changes: 10 additions & 1 deletion libscu-c/Makefile.scu
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,17 @@ build: $(TESTCASES)
clean::
rm -f $(TESTCASES) $(patsubst %,%.o,$(TESTCASES)) $(patsubst %,valgrind.%.log,$(TESTCASES))


LDFLAGS:=-L$(SCU_DIR)/libscu-c/ -lscu-c -lpthread

ifeq ($(shell uname), Darwin)
# libargp may be installed with homebrew
# brew install argp-standalone
LDFLAGS+=-largp
endif

$(TESTCASES): %:%.o $(SCU_DIR)/libscu-c/libscu-c.a
$(CC) -o $@ $< -L$(SCU_DIR)/libscu-c/ -lscu-c
$(CC) -o $@ $< $(LDFLAGS)

$(SCU_DIR)/libscu-c/libscu-c.a:
make -C $(SCU_DIR)/libscu-c
Expand Down
8 changes: 4 additions & 4 deletions libscu-c/src/scu.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <argp.h>
#include <assert.h>
#include <pthread.h>
#include <setjmp.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>

Expand Down Expand Up @@ -296,13 +296,13 @@ _scu_get_time_diff(struct timespec startt, struct timespec endt)
}

static bool _scu_fatal_assert_jmpbuf_valid;
static pid_t _scu_fatal_assert_allowed_thread_id;
static pthread_t _scu_fatal_assert_allowed_thread_id;
static jmp_buf _scu_fatal_assert_jmpbuf;

static pid_t
static pthread_t
_scu_get_current_thread_id(void)
{
return syscall(SYS_gettid);
return pthread_self();
}

void
Expand Down