Skip to content

Commit 2e1c93e

Browse files
committed
lmfuse fixing
1 parent 47ffcdc commit 2e1c93e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

configure.ac

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,4 @@ AC_CONFIG_FILES([tools/Makefile])
155155
# If we have FUSE, make lmfuse
156156
AM_CONDITIONAL([COND_LMFUSE],[test "$LIB_FUSE" = TRUE])
157157
AC_CONFIG_FILES([tools/lmfuse/Makefile])
158-
#AS_IF([test "$LIB_FUSE" = TRUE],
159-
# [AC_CONFIG_FILES([tools/lmfuse/Makefile])])
160158
AC_OUTPUT

tools/lmfuse/lmfuse.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
// Lispm epoch is 1/1/1900
2626
#define EPOCH_OFFSET 2208988800
2727

28+
#include "config.h"
2829
#include <fuse.h>
2930
#include <stdio.h>
3031
#include <stdint.h>
@@ -671,10 +672,12 @@ int lmfs_getent(char *path,Directory_Entry *dirent){
671672
// Split for filename and file type
672673
path_element_name = strtok_r(path_element,".",&pe_saveptr);
673674
path_element_type = strtok_r(NULL,"/",&pe_saveptr);
674-
if(strstr(path_element_type,"#") != NULL){
675+
if(path_element_type != NULL && strstr(path_element_type,"#") != NULL){
676+
// fprintf(stderr,"LMFS: path_element_type found number sign: %s\n",path_element_type);
675677
path_element_type = strtok_r(path_element_type,"#",&pe_saveptr); // Chop off before #
676678
path_element_version = strtok_r(NULL,"/",&pe_saveptr); // Chop off version
677679
}else{
680+
// fprintf(stderr,"LMFS: No version specified in this path element.\n");
678681
path_element_version = NULL;
679682
}
680683
}else{
@@ -917,7 +920,7 @@ static int lmfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
917920
stbuf.st_nlink = 2;
918921
}
919922
// Common stuff
920-
stbuf.st_mtimespec.tv_sec = dirent.cdate-EPOCH_OFFSET;
923+
stbuf.st_mtime = dirent.cdate-EPOCH_OFFSET;
921924
stbuf.st_size = dirent.total_size;
922925
stbuf.st_blocks = dirent.total_size/512;
923926
if(dirent.total_size > stbuf.st_blocks*512){
@@ -963,7 +966,7 @@ static int lmfs_getattr(const char *path, struct stat *stbuf){
963966
stbuf->st_nlink = 2;
964967
}
965968
// Common stuff
966-
stbuf->st_mtimespec.tv_sec = dirent.cdate-EPOCH_OFFSET;
969+
stbuf->st_mtime = dirent.cdate-EPOCH_OFFSET;
967970
stbuf->st_size = dirent.total_size;
968971
stbuf->st_blksize = 1024;
969972
stbuf->st_blocks = dirent.total_size/512;

0 commit comments

Comments
 (0)