summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 868905c)
raw | patch | inline | side by side (parent: 868905c)
author | Lennart Poettering <lennart@poettering.net> | |
Mon, 29 Mar 2004 18:23:21 +0000 (18:23 +0000) | ||
committer | Lennart Poettering <lennart@poettering.net> | |
Mon, 29 Mar 2004 18:23:21 +0000 (18:23 +0000) |
src/Makefile | patch | blob | history | |
src/fusedav.c | patch | blob | history |
diff --git a/src/Makefile b/src/Makefile
index bea2a08f33d5abcfca1618161bd0ce97c2132852..e0dca3b1f83c0dff97eda10cdd955a6d99065382 100644 (file)
--- a/src/Makefile
+++ b/src/Makefile
CC=gcc
-CFLAGS=-g -Wall -pipe -O0 -I/usr/include/neon
+CFLAGS=-g -Wall -pipe -O0 -I/usr/include/neon -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -ansi
LIBS=/usr/lib/libfuse.a -lpthread -lneon
-all: fusexmp fusedav
-
-fusexmp: fusexmp.o
- $(CC) -o $@ $^ $(LIBS)
+all: fusedav
fusedav: fusedav.o statcache.o filecache.o session.o openssl-thread.o
$(CC) -o $@ $^ $(LIBS)
clean:
- rm -f *.o fusexmp fusedav
+ rm -f *.o fusedav
.PHONY: clean all
diff --git a/src/fusedav.c b/src/fusedav.c
index 17f1001738be8184abd8a050c66e8fbcab168a47..355feae2e8e6f7606e7499ff97913949cf6c4baf 100644 (file)
--- a/src/fusedav.c
+++ b/src/fusedav.c
@@ -111,7 +111,9 @@ static void fill_stat(struct stat* st, const ne_prop_result_set *results, int is
st->st_mtime = glm ? ne_rfc1123_parse(glm) : 0;
st->st_ctime = cd ? ne_iso8601_parse(cd) : 0;
- //fprintf(stderr, "a: %u; m: %u; c: %u\n", st->st_atime, st->st_mtime, st->st_ctime);
+
+ st->st_blocks = (st->st_size+511)/512;
+ /*fprintf(stderr, "a: %u; m: %u; c: %u\n", st->st_atime, st->st_mtime, st->st_ctime);*/
st->st_mode &= ~mask;
}
static void exit_handler(int s) {
- static const char m[] = "Signal caught\n";
+ static const char m[] = "*** Caught signal ***\n";
write(2, m, strlen(m));
if(fuse != NULL)
fuse_exit(fuse);
char *u=NULL, *p = NULL;
int fuse_fd = -1;
int ret = 1;
+ char mountpoint[PATH_MAX];
+ static const char *mount_args[] = { "-n", NULL, "-l", "-c", NULL };
if (ne_sock_init()) {
fprintf(stderr, "Failed to initialize libneon.\n");
goto finish;
}
- if ((fuse_fd = fuse_mount(argv[optind+1], NULL)) < 0) {
+ if (argv[optind+1][0] == '/')
+ snprintf(mountpoint, sizeof(mountpoint), "%s", argv[optind+1]);
+ else {
+ char *pwd = get_current_dir_name();
+ snprintf(mountpoint, sizeof(mountpoint), "%s/%s", pwd, argv[optind+1]);
+ free(pwd);
+ }
+
+ mount_args[1] = argv[optind];
+
+ if ((fuse_fd = fuse_mount(mountpoint, mount_args)) < 0) {
fprintf(stderr, "Failed to mount FUSE file system.\n");
goto finish;
}
fuse_destroy(fuse);
if (fuse_fd >= 0)
- fuse_unmount(argv[optind]);
+ fuse_unmount(mountpoint);
file_cache_close_all();
cache_free();