Skip to content

Commit

Permalink
Fixed linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Dummm committed Dec 26, 2018
1 parent 2c6208e commit c19a97a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ default: sifs
# countwords.o, counter.o, and scanner.o:
#

sifs: sifs.o src/logger.o src/tree.o
$(CC) $(CFLAGS) -o sifs src/logger.o src/tree.o sifs.o
sifs: sifs.o src/logger.o src/tree.o src/getattr.o
$(CC) $(CFLAGS) -o sifs src/logger.o src/tree.o src/getattr.o sifs.o

# To create the object file countwords.o, we need the source
# files countwords.c, scanner.h, and counter.h:
Expand All @@ -40,9 +40,13 @@ logger.o: src/logger.c lib/logger.h
tree.o: src/tree.c lib/tree.h
$(CC) $(CFLAGS) -c tree.c

getattr.o: src/getattr.c lib/getattr.h
$(CC) $(CFLAGS) -c sifs.c

sifs.o: sifs.c lib/tar_structure.h
$(CC) $(CFLAGS) -c sifs.c


# To start over from scratch, type 'make clean'. This
# removes the executable file, as well as old .o object
# files and *~ backup files:
Expand Down
1 change: 1 addition & 0 deletions lib/getattr.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef getattr_h
#define getattr_h
#include "../lib/tree.h"
#include "../lib/logger.h"
#include <sys/stat.h>
int sifs_getattr(const char*, struct stat*);
Expand Down
8 changes: 4 additions & 4 deletions sifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <sys/stat.h>

// #include "lib/destroy.h"
// #include "lib/getattr.h"
#include "lib/getattr.h"
// #include "lib/fgetattr.h"
// #include "lib/access.h"
// #include "lib/readlink.h"
Expand Down Expand Up @@ -49,7 +49,7 @@
// #include "lib/lock.h"

#include "lib/logger.h"
#include "lib/tree.h"
//#include "lib/tree.h"
#include "lib/tar_structure.h"
#include <fuse.h>

Expand Down Expand Up @@ -185,9 +185,9 @@ void* sifs_init(struct fuse_conn_info* conn) {
}

static struct fuse_operations sifs_oper = {
.init = sifs_init
.init = sifs_init,
// .destroy = sifs_destroy,
// .getattr = sifs_getattr,
.getattr = sifs_getattr
// .fgetattr = sifs_fgetattr,
// .access = sifs_access,
// .readlink = sifs_readlink,
Expand Down
14 changes: 10 additions & 4 deletions src/getattr.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#include "../lib/getattr.h"

int sifs_getattr(const char* path, struct stat* sbuf) {
logger(DEBUG, "[init] Started\n");
int _sifs_getattr(const char* path, struct stat* sbuf) {
return 0;
}

int sifs_getattr(const char* path, struct stat* sbuf) {
logger(DEBUG, "[getattr] Started\n");
printf("caca\n");

int ret;
ret = _sifs_getattr(path, sbuf);

logger(DEBUG, "[init] Ended\n");
return -1;
logger(DEBUG, "[getattr] Ended\n");
return ret;
}

0 comments on commit c19a97a

Please sign in to comment.