preparing 2.0.3, removed fanotify stubs, not coming soon

This commit is contained in:
Axel Kittenberger 2011-02-25 14:53:06 +00:00
parent cbe9d5c03b
commit 547562f6ec
6 changed files with 17 additions and 164 deletions

View File

@ -1,3 +1,18 @@
25-02-2011: 2.0.3
enhancement: new default target --direct using /bin/ binaries
to keep to local dirs in sync (and by default
not preserving ownership)
example: added a new example how to remotely execute a command
after each rsync operations
fix: possible crash with long rsyncOps table exceeding lua stack.
fix: excludes now properly match relative and absolute paths
fix: call to nil function when manually adding blanket delays
fix: on ReiserFS not delivering proper dir stats and when encountering
a symlink, aquire the node stat for the symlink instead from
the linked node.
change: leave lua apichecking enabled by default.
20-01-2011: 2.0.2
fix: exclude rules not terminated with '/' now match a file
or dir named exactly the same not starting with.

View File

@ -5,9 +5,6 @@ lsyncd_SOURCES = lsyncd.h lsyncd.c lsyncd.lua
if INOTIFY
lsyncd_SOURCES += inotify.c
endif
#if FANOTIFY
#lsyncd_SOURCES += fanotify.c
#endif
#if FSEVENTS
#lsyncd_SOURCES += fsevents.c

View File

@ -1,8 +1,7 @@
# -*- Autoconf -*-
echo XXXXXXXXX
# Process this file with autoconf to produce a configure script.
#AC_PREREQ(2.60)
AC_INIT(lsyncd, 2.0.2, axkibe@gmail.com)
AC_INIT(lsyncd, 2.0.3, axkibe@gmail.com)
AC_CONFIG_SRCDIR([lsyncd.c])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
@ -24,7 +23,6 @@ PKG_CHECK_MODULES([LUA], [lua >= 5.1.3])
###
# Checks for header files.
AC_CHECK_HEADERS([sys/inotify.h])
AC_CHECK_HEADERS([sys/fanotify.h])
###
# --with-runner option
@ -53,22 +51,6 @@ else
fi
AM_CONDITIONAL([INOTIFY], [test x${with_inotify} != xno])
####
## --with-fanotify option
## disabled, does not work.
##
#AC_ARG_WITH([fanotify],
#[ --with-fanotify Uses Linux new fanotify event interface. EXPERIMENTAL!
# Off by default.])
#if test "x${with_fanotify}" == x || test "x${with_fanotify}no" == xno; then
# echo "compiling without fanotify"
#else
# echo "compiling with fanotify - WARNING experimental!"
# AC_DEFINE(LSYNCD_WITH_FANOTIFY,,"descr")
#fi
#AM_CONDITIONAL([FANOTIFY],
# [test x${with_fanotify} != x -a x${with_fanotify} != xno])
####
## --with-fsevents
## disabled per default, experimental, works only with OS X 10.5

View File

@ -1,38 +0,0 @@
/**
* Hack for yet missing fanotify interface in glibc.
* Does the syscalls by itself.
*
* TODO: Delete this as soon a glibc release supports this.
*/
#ifndef FANOTIFY_SYSCALL
#define FANOTIFY_SYSCALL
#define __EXPORTED_HEADERS__
#include <linux/types.h>
#undef __EXPORTED_HEADERS__
#include <unistd.h>
#if defined(__x86_64__)
# define __NR_fanotify_init 300
# define __NR_fanotify_mark 301
#elif defined(__i386__)
# define __NR_fanotify_init 338
# define __NR_fanotify_mark 339
#else
# error "System call numbers not defined for this architecture"
#endif
static int fanotify_init(unsigned int flags, unsigned int event_f_flags)
{
return syscall(__NR_fanotify_init, flags, event_f_flags);
}
static int fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
int dfd, const char *pathname)
{
return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask,
dfd, pathname);
}
#endif

View File

@ -1,103 +0,0 @@
/**
* fsevents.c from Lsyncd - Live (Mirror) Syncing Demon
*
* License: GPLv2 (see COPYING) or any later version
*
* Authors: Axel Kittenberger <axkibe@gmail.com>
*
* -----------------------------------------------------------------------
*
* Interface to Linux' new filesystem monitor - fanotify.
*/
#include "lsyncd.h"
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#ifdef HAVE_SYS_FANOTIFY_H
# include <sys/fanotify.h>
#else
# warning sys/fanotify.h not found, using own syscalls as workaround.
# include "fanotify-syscall.h"
#endif
/**
* The fanotify file descriptor.
*/
static int fanotify_fd = -1;
/**
* Adds a filesystem to watch
*
* @param dir (Lua stack) the dir to watch the filesystem of.
* @return nil
*/
static int
l_watchfs(lua_State *L)
{
// const char *path = luaL_checkstring(L, 1);
return 0;
}
/**
* Cores fanotify functions.
*/
static const luaL_reg lfanotifylib[] = {
{"watchfs", l_watchfs },
{NULL, NULL}
};
/**
* registers fanoitfy functions.
*/
extern void
register_fanotify(lua_State *L) {
lua_pushstring(L, "fanotify");
luaL_register(L, "fanotify", lfanotifylib);
}
/**
* Called by function pointer from when the inotify file descriptor
* became ready. Reads it contents and forward all received events
* to the runner.
*/
static void
fanotify_ready(lua_State *L, struct observance *ob)
{
// TODO
}
/**
* closes fanoitfy
*/
extern void
fanotify_tidy(struct observance *ob) {
if (ob->fd != fanotify_fd) {
logstring("Error", "Internal, fanotify_fd != ob->fd");
exit(-1); // ERRNO
}
close(fanotify_fd);
}
/**
* opens and initalizes fanotify.
*/
extern void
open_fanotify(lua_State *L) {
fanotify_fd = fanotify_init(O_CLOEXEC | O_NONBLOCK, O_RDONLY);
if (fanotify_fd < 0) {
printlogf(L, "Error",
"Cannot access fanotify monitor! (%d:%s)",
errno, strerror(errno));
exit(-1); // ERRNO
}
observe_fd(fanotify_fd, fanotify_ready, NULL, fanotify_tidy, NULL);
}

View File

@ -22,7 +22,7 @@ if lsyncd_version then
"You cannot use the lsyncd runner as configuration file!")
lsyncd.terminate(-1) -- ERRNO
end
lsyncd_version = "2.0.2"
lsyncd_version = "2.0.3"
-----
-- Hides the core interface from user scripts