Subversion Repositories public

Compare Revisions

Ignore whitespace Rev 107 → Rev 108

/incron/trunk/Doxyfile
31,7 → 31,7
# This could be handy for archiving the generated documentation or
# if some version control system is used.
 
PROJECT_NUMBER = 0.5.9
PROJECT_NUMBER = 0.5.10
 
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
/incron/trunk/VERSION
1,0 → 0,0
0.5.9
0.5.10
/incron/trunk/CHANGELOG
1,3 → 1,11
0.5.10 2012-04-05
* some includes fixed to build correctly with GCC 4.6 (and 4.4-4.5 - #0000385, #0000447)
* some type issues fixed (#0000447)
* EAGAIN handling in poll() (#0000399, #0000686, #0000691)
* Makefile improved as of #0000512
* typo in various files fixed (#0000412)
 
 
0.5.9 2009-06-21
* spaces in event-related file names now handled correctly (#0000174)
* crashing on 'incrontab --user' fixed (#0000187)
/incron/trunk/LICENSE-X11
1,4 → 1,4
Copyright (c) 2006, 2007, 2008, 2009 Lukas Jelinek
Copyright (c) 2006, 2007, 2008, 2009, 2012 Lukas Jelinek
 
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
/incron/trunk/incrontab.cpp
5,17 → 5,20
*
* inotify cron system
*
* Copyright (C) 2006, 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2006, 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can use it, redistribute
* it and/or modify it under the terms of the GNU General Public
* License, version 2 (see LICENSE-GPL).
*
* Credits:
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
 
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <errno.h>
 
#include "inotify-cxx.h"
/incron/trunk/inotify-cxx.cpp
5,7 → 5,7
*
* inotify C++ interface
*
* Copyright (C) 2006, 2007, 2008 Lukas Jelinek <lukas@aiken.cz>
* Copyright (C) 2006, 2007, 2008, 2012 Lukas Jelinek <lukas@aiken.cz>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of one of the following licenses:
17,6 → 17,9
* If you want to help with choosing the best license for you,
* please visit http://www.gnu.org/licenses/license-list.html.
*
* Credits:
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
23,6 → 26,7
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <cstdio>
 
#include "inotify-cxx.h"
 
/incron/trunk/icd-main.cpp
5,12 → 5,15
*
* inotify cron system
*
* Copyright (C) 2006, 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2006, 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can use it, redistribute
* it and/or modify it under the terms of the GNU General Public
* License, version 2 (see LICENSE-GPL).
*
* Credits:
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
#include <map>
23,6 → 26,7
#include <errno.h>
#include <sys/poll.h>
#include <sys/stat.h>
#include <cstdio>
#include <cstring>
 
#include "inotify-cxx.h"
79,6 → 83,9
/// Daemonize true/false
bool g_daemon = true;
 
/// Second to wait on EAGAIN
#define POLL_EAGAIN_WAIT 3
 
/// Handles a signal.
/**
* For SIGTERM and SIGINT it sets the program finish variable.
448,8 → 455,16
UserTable::FinishDone();
}
else if (res < 0) {
if (errno != EINTR)
throw InotifyException("polling failed", errno, NULL);
switch (errno) {
case EINTR: // syscall interrupted - continue polling
break;
case EAGAIN: // not enough resources - wait a moment and try again
syslog(LOG_WARNING, "polling failed due to resource shortage, retrying later...");
sleep(POLL_EAGAIN_WAIT);
break;
default:
throw InotifyException("polling failed", errno, NULL);
}
}
}
/incron/trunk/COPYING
1,6 → 1,6
inotify cron system
Copyright (C) 2006,2007,2008,2009 Lukas Jelinek, <lukas@aiken.cz>
Copyright (C) 2006,2007,2008,2009,2012 Lukas Jelinek, <lukas@aiken.cz>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License,
/incron/trunk/Makefile
3,13 → 3,14
USERDATADIR = /var/spool/incron
SYSDATADIR = /etc/incron.d
CFGDIR = /etc
MANPATH = /usr/share/man
MANPATH = $(PREFIX)/share/man
RELEASE = incron-`cat VERSION`
RELEASEDIR = /tmp/$(RELEASE)
DOCDIR = $(PREFIX)/share/doc/$(RELEASE)/
 
USER = root
 
CXX = g++
CXX ?= g++
INSTALL = install
 
OPTIMIZE = -O2
17,8 → 18,8
WARNINGS = -Wall
CXXAUX = -pipe
 
CXXFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS) $(CXXAUX)
LDFLAGS = $(WARNINGS)
CXXFLAGS ?= $(OPTIMIZE) $(DEBUG) $(CXXAUX)
CXXFLAGS += $(WARNINGS)
 
PROGRAMS = incrond incrontab
 
29,10 → 30,10
all: $(PROGRAMS)
 
incrond: $(INCROND_OBJ)
$(CXX) $(LDFLAGS) -o $@ $(INCROND_OBJ)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCROND_OBJ)
 
incrontab: $(INCRONTAB_OBJ)
$(CXX) $(LDFLAGS) -o $@ $(INCRONTAB_OBJ)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(INCRONTAB_OBJ)
 
.cpp.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
44,33 → 45,34
distclean: clean
 
install: all install-man
[ -d $(PREFIX) ]
$(INSTALL) -m 04755 -o $(USER) incrontab $(PREFIX)/bin/
$(INSTALL) -m 0755 incrond $(PREFIX)/sbin/
$(INSTALL) -m 0755 -o $(USER) -d $(USERDATADIR)
$(INSTALL) -m 0755 -o $(USER) -d $(SYSDATADIR)
$(INSTALL) -m 0644 -o $(USER) incron.conf.example $(CFGDIR)
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin/
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/sbin/
$(INSTALL) -m 0755 -d $(DESTDIR)$(DOCDIR)/
$(INSTALL) -m 04755 -o $(USER) incrontab $(DESTDIR)$(PREFIX)/bin/
$(INSTALL) -m 0755 incrond $(DESTDIR)$(PREFIX)/sbin/
$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(USERDATADIR)
$(INSTALL) -m 0755 -o $(USER) -d $(DESTDIR)$(SYSDATADIR)
$(INSTALL) -m 0644 incron.conf.example $(DESTDIR)$(DOCDIR)/
 
install-man: incrontab.1 incrontab.5 incrond.8 incron.conf.5
$(INSTALL) -m 0755 -d $(MANPATH)/man1
$(INSTALL) -m 0755 -d $(MANPATH)/man5
$(INSTALL) -m 0755 -d $(MANPATH)/man8
$(INSTALL) -m 0644 incrontab.1 $(MANPATH)/man1
$(INSTALL) -m 0644 incrontab.5 $(MANPATH)/man5
$(INSTALL) -m 0644 incrond.8 $(MANPATH)/man8
$(INSTALL) -m 0644 incron.conf.5 $(MANPATH)/man5
$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man1
$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man5
$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPATH)/man8
$(INSTALL) -m 0644 incrontab.1 $(DESTDIR)$(MANPATH)/man1
$(INSTALL) -m 0644 incrontab.5 $(DESTDIR)$(MANPATH)/man5
$(INSTALL) -m 0644 incrond.8 $(DESTDIR)$(MANPATH)/man8
$(INSTALL) -m 0644 incron.conf.5 $(DESTDIR)$(MANPATH)/man5
 
uninstall: uninstall-man
[ -d $(PREFIX) ]
rm -f $(PREFIX)/bin/incrontab
rm -f $(PREFIX)/sbin/incrond
rm -f $(CFGDIR)/incron.conf.example
rm -f $(DESTDIR)$(PREFIX)/bin/incrontab
rm -f $(DESTDIR)$(PREFIX)/sbin/incrond
rm -rf $(DESTDIR)$(DOCDIR)/
 
uninstall-man:
rm -f $(MANPATH)/man1/incrontab.1
rm -f $(MANPATH)/man5/incrontab.5
rm -f $(MANPATH)/man8/incrond.8
rm -f $(MANPATH)/man5/incron.conf.5
rm -f $(DESTDIR)$(MANPATH)/man1/incrontab.1
rm -f $(DESTDIR)$(MANPATH)/man5/incrontab.5
rm -f $(DESTDIR)$(MANPATH)/man8/incrond.8
rm -f $(DESTDIR)$(MANPATH)/man5/incron.conf.5
 
update: uninstall install
 
/incron/trunk/appargs.cpp
5,7 → 5,7
*
* application arguments processor
*
* Copyright (C) 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of one of the following licenses:
17,9 → 17,13
* If you want to help with choosing the best license for you,
* please visit http://www.gnu.org/licenses/license-list.html.
*
* Credits:
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
 
#include <cstdio>
#include <cstring>
 
#include "strtok.h"
/incron/trunk/incron.conf.5
35,7 → 35,7
.BR Default : \fIincrond\fR
.TP
\fBeditor\fP
This name or path is used to run as an editor for editting incron tables. Default \fIno editor\fR is given, system editor used, this option overide this.
This name or path is used to run as an editor for editing incron tables. Default \fIno editor\fR is given, system editor used, this option overide this.
.SH "SEE ALSO"
incrond(8), incrontab(1), incrontab(5)
.SH "AUTHOR"
/incron/trunk/ict-main.cpp
5,7 → 5,7
*
* inotify cron system
*
* Copyright (C) 2006, 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2006, 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can use it, redistribute
* it and/or modify it under the terms of the GNU General Public
13,6 → 13,7
*
* Credits:
* kolter (fix for segfaulting on --user)
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
20,7 → 21,6
#include <argp.h>
#include <pwd.h>
#include <string>
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/wait.h>
29,6 → 29,7
#include <stdlib.h>
#include <limits.h>
#include <cstring>
#include <cstdio>
 
#include "inotify-cxx.h"
#include "appargs.h"
60,7 → 61,7
" -h, --help prints this help text\n" \
" -l, --list lists user table\n" \
" -r, --remove removes user table\n" \
" -e, --edit provides editting user table\n" \
" -e, --edit provides editing user table\n" \
" -t, --types list supported event types\n" \
" -d, --reload request incrond to reload user table\n" \
" -V, --version prints program version\n\n" \
/incron/trunk/incroncfg.cpp
5,12 → 5,15
*
* incron configuration
*
* Copyright (C) 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can use it, redistribute
* it and/or modify it under the terms of the GNU General Public
* License, version 2 (see LICENSE-GPL).
*
* Credits:
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
 
181,7 → 184,7
 
bool IncronCfg::IsComment(const char* s)
{
char* sx = strchr(s, '#');
const char* sx = strchr(s, '#'); //
if (sx == NULL)
return false;
/incron/trunk/README
1,7 → 1,7
 
inotify cron system
 
(c) Lukas Jelinek, 2006, 2007, 2008, 2009
(c) Lukas Jelinek, 2006, 2007, 2008, 2009, 2012
 
1. About
2. Requirements
41,7 → 41,7
 
The binaries must be of course installed as root.
 
If you want to use (after editting) the example configuration
If you want to use (after editing) the example configuration
file simply rename it from /etc/incron.conf.example to
/etc/incron.conf (you can also use -f <config> for one-time
use of a custom configuration file).
/incron/trunk/appinst.cpp
3,7 → 3,7
/**
* \file appinst.cpp
*
* Copyright (C) 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of one of the following licenses:
15,14 → 15,17
* If you want to help with choosing the best license for you,
* please visit http://www.gnu.org/licenses/license-list.html.
*
* Credits:
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <cstdio>
 
#include "appinst.h"
 
/incron/trunk/incron.conf.example
63,7 → 63,7
 
# Parameter: editor
# Meaning: editor executable
# Description: This name or path is used to run as an editor for editting
# Description: This name or path is used to run as an editor for editing
# user tables.
# Default: vim
#
/incron/trunk/usertable.cpp
5,7 → 5,7
*
* inotify cron system
*
* Copyright (C) 2006, 2007, 2008 Lukas Jelinek, <lukas@aiken.cz>
* Copyright (C) 2006, 2007, 2008, 2012 Lukas Jelinek, <lukas@aiken.cz>
*
* This program is free software; you can use it, redistribute
* it and/or modify it under the terms of the GNU General Public
14,6 → 14,7
* Credits:
* David Santinoli (supplementary groups)
* Boris Lechner (spaces in event-related file names)
* Christian Ruppert (new include to build with GCC 4.4+)
*
*/
 
26,6 → 27,7
#include <grp.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <cstdio>
#include <cstring>
 
#include "usertable.h"
/incron/trunk/incrontab.1
24,7 → 24,7
 
\fB\-r\fR (or \fB\-\-remove\fR) option causes the current table (if any) is permanently remove without any warning or confirmation. Use with caution!
 
\fB\-e\fR (or \fB\-\-edit\fR) option causes executing an editor for editting the user table (see below for the information about editor selection). You can edit your incron table now. If the table is changed it stores the modified version.
\fB\-e\fR (or \fB\-\-edit\fR) option causes executing an editor for editing the user table (see below for the information about editor selection). You can edit your incron table now. If the table is changed it stores the modified version.
 
\fB\-t\fR (or \fB\-\-types\fR) option causes the list of supported event types (delimited by commas) is printed to the standard output. This feature is intended for front\-end applications to find out which event types was compiled in.
 
32,7 → 32,7
 
\fB\-f <FILE>\fR (or \fB\-\-config=<FILE>\fR) option specifies another location for the configuration file (/etc/incron.conf is used by default). This feature requires root privileges.
 
There is a few complex algorithm how to determine which editor will be user for editting. If any of the following rule succeeds the appropriate editor is used:
There is a few complex algorithm how to determine which editor will be user for editing. If any of the following rule succeeds the appropriate editor is used:
 
1. EDITOR environment variable