diff --git a/Makefile.am b/Makefile.am index 7eb6622..fdd269f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS=httpfs -httpfs_LDADD=-lhurdbugaddr -lnetfs -lfshelp -lthreads -lports -liohelp -lxml2 -lshouldbeinlibc +httpfs_LDADD=$(LIBS) -lhurdbugaddr -lnetfs -lfshelp -lthreads -lports -liohelp -lshouldbeinlibc httpfs_SOURCES=httpfs.c \ netfs.c \ args.c \ diff --git a/configure.in b/configure.in index a53d11c..8de56fb 100644 --- a/configure.in +++ b/configure.in @@ -1,10 +1,16 @@ +AC_INIT(httpfs, 0.1) +AC_CONFIG_SRCDIR(Makefile.am) +AM_INIT_AUTOMAKE +AC_PROG_CC -AC_INIT(Makefile.am) +PKG_CHECK_MODULES(HTTPFS, libxml-2.0) -AM_INIT_AUTOMAKE(httpfs, 0.1, no-define) +CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 $HTTPFS_CFLAGS" +LIBS="$LIBS $HTTPFS_LIBS" -AC_PROG_CC +AC_SUBST(LIBS) +AM_CONFIG_HEADER(config.h) AC_OUTPUT( Makefile diff --git a/httpfs.c b/httpfs.c index ca92d41..a3c1b0d 100644 --- a/httpfs.c +++ b/httpfs.c @@ -42,6 +42,9 @@ struct files *list_of_entries = NULL, *this_entry; struct httpfs *httpfs; /* filesystem global pointer */ volatile struct mapped_time_value *httpfs_maptime; +char *netfs_server_name = HTTPFS_SERVER_NAME; +char *netfs_server_version = HTTPFS_SERVER_VERSION; + int main (int argc, char **argv) { diff --git a/httpfs.h b/httpfs.h index cdf825f..e3c7a25 100644 --- a/httpfs.h +++ b/httpfs.h @@ -23,6 +23,11 @@ #include +#include "config.h" + +#define HTTPFS_SERVER_NAME PACKAGE +#define HTTPFS_SERVER_VERSION VERSION + /* declaration of global configuration parameters */ extern int debug_flag; extern volatile struct mapped_time_value *httpfs_maptime; diff --git a/netfs.c b/netfs.c index 720f8c0..4fe8085 100644 --- a/netfs.c +++ b/netfs.c @@ -77,16 +77,14 @@ netfs_attempt_utimes (struct iouser *cred, struct node *node, err = fshelp_isowner (&node->nn_stat, cred); if (!err) { - if (atime) { - node->nn_stat.st_atime = atime->tv_sec; - node->nn_stat.st_atime_usec = atime->tv_nsec / 1000; - } else + if (atime) + node->nn_stat.st_atim = *atime; + else flags |= TOUCH_ATIME; - if (mtime) { - node->nn_stat.st_mtime = mtime->tv_sec; - node->nn_stat.st_mtime_usec = mtime->tv_nsec / 1000; - } else + if (mtime) + node->nn_stat.st_mtim = *mtime; + else flags |= TOUCH_MTIME; fshelp_touch (&node->nn_stat, flags, httpfs_maptime); @@ -412,7 +410,7 @@ error_t netfs_attempt_chflags (struct iouser *cred, struct node *node, /* This should attempt to set the size of the file NODE (for user CRED) to SIZE bytes long. */ error_t netfs_attempt_set_size (struct iouser *cred, struct node *node, - off_t size) + loff_t size) { return EROFS; } @@ -420,7 +418,7 @@ error_t netfs_attempt_set_size (struct iouser *cred, struct node *node, /* This should attempt to fetch filesystem status information for the remote filesystem, for the user CRED. */ error_t netfs_attempt_statfs (struct iouser *cred, struct node *node, - struct statfs *st) + fsys_statfsbuf_t *st) { return EOPNOTSUPP; } @@ -464,7 +462,7 @@ error_t netfs_attempt_readlink (struct iouser *user, struct node *node, up to *LEN bytes. Put the data at DATA. Set *LEN to the amount successfully read upon return. */ error_t netfs_attempt_read (struct iouser *cred, struct node *node, - off_t offset, size_t *len, void *data) + loff_t offset, size_t *len, void *data) { error_t err; static int remote_fd; @@ -504,7 +502,7 @@ error_t netfs_attempt_read (struct iouser *cred, struct node *node, to *LEN bytes from DATA. Set *LEN to the amount seccessfully written upon return. */ error_t netfs_attempt_write (struct iouser *cred, struct node *node, - off_t offset, size_t *len, void *data) + loff_t offset, size_t *len, void *data) { return EROFS; }