Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile and compiler warning fixes #3

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
CC=gcc
CFLAGS=-I. -Ipipe_elements/. -Iinput_elements/. -Wno-pointer-sign -Wno-variadic-macros -O0 -g
LIBS=-lyajl -lcurl -lssl -lcrypto
CC?=gcc
CFLAGS+=-I. -Ipipe_elements/. -Iinput_elements/. -Wno-pointer-sign -Wno-variadic-macros -O0 -g
LIBS+=-lyajl -lcurl -lssl -lcrypto

all: mlogc-ng

%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
Expand All @@ -17,7 +19,7 @@ OBJS = \
pipe_elements/send_to_server.o

mlogc-ng: $(OBJS)
gcc -o $@ $^ $(CFLAGS) $(LIBS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

clean:
rm *.o pipe_elements/*.o input_elements/*.o mlogc-ng
rm -f *.o pipe_elements/*.o input_elements/*.o mlogc-ng
2 changes: 1 addition & 1 deletion input_elements/filesystem-walker.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int inspect_file(unsigned char *full_path, void *audit_log_entry_cb,
return res;
}

int open_directory_recursive(unsigned char *path, void *audit_log_entry_cb,
int open_directory_recursive(const unsigned char *path, void *audit_log_entry_cb,
struct read_from_filesystem_config_t *conf)
{
DIR *d;
Expand Down
5 changes: 4 additions & 1 deletion input_elements/filesystem-walker.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
#ifndef __FILESYSTEM_WALKER_H__
#define __FILESYSTEM_WALKER_H__

#include "read_from_filesystem.h"

int inspect_file(unsigned char *, void *);
int open_directory_recursive(unsigned char *, void *);
int open_directory_recursive(const unsigned char *, void *,
struct read_from_filesystem_config_t *);

#endif
2 changes: 1 addition & 1 deletion input_elements/input_batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int load_buffer(char *buf, struct audit_log_entry_t *audit_log)

char number[20];
memset(number, '\0', 20);
snprintf(number, 20, "%d", strlen(buf));
snprintf(number, 20, "%lu", strlen(buf));

audit_log->mark = mark;
audit_log->buf = buf;
Expand Down
1 change: 1 addition & 0 deletions input_elements/read_from_filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "configuration.h"

#include "read_from_filesystem.h"
#include "filesystem-walker.h"


int read_from_filesystem_call_entry_cb(struct audit_log_entry_t *audit_log,
Expand Down
2 changes: 1 addition & 1 deletion pipe_elements/persistence.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "persistence.h"
#include "pipeline.h"

inline int persistence_file_exists(const char *file)
int persistence_file_exists(const char *file)
{
struct stat buffer;
return (stat (file, &buffer) == 0);
Expand Down
2 changes: 2 additions & 0 deletions pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ struct pipeline_t {

struct pipeline_element_t *create_pipe_element(const char *, const yajl_val *,
struct pipeline_t *);
int add_pipe_element(struct pipeline_t *, struct pipeline_element_t *);
int pipeline_process(struct pipeline_t *, struct audit_log_entry_t *);

#endif