summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile2
-rw-r--r--src/encryption.c16
-rwxr-xr-xsrc/main.c2
-rw-r--r--src/tests.c2
4 files changed, 13 insertions, 9 deletions
diff --git a/src/Makefile b/src/Makefile
index de0c9f6..0a72955 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -29,7 +29,7 @@ $(TIMESTAMPS): $(TIMESTAMP_DIR)/%.t: %.c | $(TIMESTAMP_DIR)
29 touch $@ 29 touch $@
30 30
31main tests: %: %.c $(TIMESTAMPS) 31main tests: %: %.c $(TIMESTAMPS)
32 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ 32 $(CC) -D_GNU_SOURCE=1 $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
33 33
34 34
35# Phony rules 35# Phony rules
diff --git a/src/encryption.c b/src/encryption.c
index aafb972..c3f77ce 100644
--- a/src/encryption.c
+++ b/src/encryption.c
@@ -14,12 +14,11 @@
14// I need to make sure every single function in this file returns with an indicated error instead of nuking the whole program with 14// I need to make sure every single function in this file returns with an indicated error instead of nuking the whole program with
15// error() 15// error()
16 16
17#define _GNU_SOURCE 1
18
17#ifndef __VXGG_REWRITE___ENCRYPTION_C___1481879318188___ 19#ifndef __VXGG_REWRITE___ENCRYPTION_C___1481879318188___
18#define __VXGG_REWRITE___ENCRYPTION_C___1481879318188___ 20#define __VXGG_REWRITE___ENCRYPTION_C___1481879318188___
19 21
20
21#define _GNU_SOURCE
22
23#define TPSIZE (1<<13) 22#define TPSIZE (1<<13)
24 23
25#include "shared.c" 24#include "shared.c"
@@ -29,14 +28,17 @@
29 28
30#include <sys/types.h> 29#include <sys/types.h>
31#include <sys/stat.h> 30#include <sys/stat.h>
31#include <fcntl.h>
32
32#include <dirent.h> 33#include <dirent.h>
33#include <stdarg.h> 34#include <stdarg.h>
34#include <string.h>
35#include <unistd.h> 35#include <unistd.h>
36
37#include <stdio.h>
38#include <string.h>
39
36#include <errno.h> 40#include <errno.h>
37#include <error.h> 41#include <error.h>
38#include <fcntl.h>
39#include <stdio.h>
40 42
41/// Determines whether any function that calls libsodium functions also checks to make sure libsodium is actually initialized. May 43/// Determines whether any function that calls libsodium functions also checks to make sure libsodium is actually initialized. May
42/// cause unexpected issues with early exiting due to libsodium failing to initialize properly. It's recommended that you just 44/// cause unexpected issues with early exiting due to libsodium failing to initialize properly. It's recommended that you just
@@ -626,7 +628,7 @@ ctqueue * cryptscan() {
626 ctqueue *res = ctqueue_init(TPSIZE), *working = ctqueue_init(TPSIZE); 628 ctqueue *res = ctqueue_init(TPSIZE), *working = ctqueue_init(TPSIZE);
627 if(!res || !working) ERRRET(errno, NULL); 629 if(!res || !working) ERRRET(errno, NULL);
628 630
629 task *start = task_init(__cscan_worker, free, void *data); 631 task *start = task_init(__cscan_worker, free, NULL);
630 if(!start) ERRRET(errno, NULL); 632 if(!start) ERRRET(errno, NULL);
631 ctqueue_waitpush(working, start); 633 ctqueue_waitpush(working, start);
632 634
diff --git a/src/main.c b/src/main.c
index b5b4a5f..c9cc873 100755
--- a/src/main.c
+++ b/src/main.c
@@ -9,6 +9,8 @@
9 * 9 *
10 */ 10 */
11 11
12#define _GNU_SOURCE 1
13
12#include "shared.c" 14#include "shared.c"
13#include "encryption.c" 15#include "encryption.c"
14#include "threadpool.c" 16#include "threadpool.c"
diff --git a/src/tests.c b/src/tests.c
index 882fdc2..2b98b3d 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -1,4 +1,4 @@
1#define _GNU_SOURCE 1#define _GNU_SOURCE 1
2 2
3#include "shared.c" 3#include "shared.c"
4#include "encryption.c" 4#include "encryption.c"