Subversion Repositories public

Compare Revisions

Ignore whitespace Rev 72 → Rev 73

/incron/trunk/ict-main.cpp
106,11 → 106,18
std::string tp(IncronTab::GetUserTablePath(rUser));
if (unlink(tp.c_str()) != 0 && errno != ENOENT) {
fprintf(stderr, "cannot remove table for user '%s': %s\n", rUser.c_str(), strerror(errno));
return false;
if (unlink(tp.c_str()) != 0) {
if (errno == ENOENT) {
fprintf(stderr, "table for user '%s' does not exist\n", rUser.c_str());
return true;
}
else {
fprintf(stderr, "cannot remove table for user '%s': %s\n", rUser.c_str(), strerror(errno));
return false;
}
}
 
fprintf(stderr, "table for user '%s' successfully removed\n", rUser.c_str());
return true;
}
 
/incron/trunk/incrontab.5
1,4 → 1,4
.TH "incrontab" "5" "0.5.1" "Lukas Jelinek" "incron documentation"
.TH "incrontab" "5" "0.5.2" "Lukas Jelinek" "incron documentation"
.SH "NAME"
incrontab \- tables for driving inotify cron (incron)
.SH "DESCRIPTION"
/incron/trunk/CHANGELOG
1,10 → 1,15
0.5.1 2007-01-28
0.5.2 2007-02-04
* lockfile permissions changed to 0644 (reopened #0000137)
* incorrect reporting of removing non-existing tables fixed (#0000141)
 
 
0.5.1 2007-01-28
* lockfile location problems fixed (#0000137)
* lockfile configuration failure fixed (#0000140)
* CRLFs inside LICENCE-GPL changed to LFs (#0000138)
 
 
0.5.0 2007-01-27
0.5.0 2007-01-27
* based on inotify-cxx 0.7.1
* bug related to events names fixed (#0000134)
* instance locking (only one instance allowed - also fixes #0000136)
/incron/trunk/appinst.cpp
26,6 → 26,8
 
#include "appinst.h"
 
/// Lockfile permissions (currently 0644)
#define APPLOCK_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
 
AppInstance::AppInstance(const std::string& rName, const std::string& rBase)
50,7 → 52,7
 
bool AppInstance::DoLock()
{
int fd = open(m_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
int fd = open(m_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, APPLOCK_PERM);
if (fd != -1) {
FILE* f = fdopen(fd, "w");
if (f == NULL) {
/incron/trunk/icd-main.cpp
313,7 → 313,7
if (AppArgs::ExistsOption("kill")) {
fprintf(stderr, "attempting to terminate a running instance of incrond...\n");
if (app.SendSignal(SIGTERM)) {
if (app.Terminate()) {
fprintf(stderr, "instance(s) notified, going down\n");
return 0;
}
/incron/trunk/incrond.8
1,4 → 1,4
.TH "incrond" "8" "0.5.1" "Lukas Jelinek" "incron documentation"
.TH "incrond" "8" "0.5.2" "Lukas Jelinek" "incron documentation"
.SH "NAME"
incrond \- inotify cron (incron) daemon
 
/incron/trunk/appinst.h
115,12 → 115,23
*/
bool SendSignal(int iSigNo) const;
/// Terminates an instance of this application.
/**
* This method doesn't terminate the current instance.
*
* \return true = success, false = otherwise
*/
inline bool Terminate() const
{
return SendSignal(SIGTERM);
}
protected:
bool DoLock();
private:
std::string m_path;
bool m_fLocked;
std::string m_path; ///< lock path
bool m_fLocked; ///< locked yes/no
};
 
#endif /*APPINST_H_*/
/incron/trunk/incron.h
27,7 → 27,7
#define INCRONTAB_NAME "incrontab"
 
/// Application version (release)
#define INCRON_VERSION "0.5.1"
#define INCRON_VERSION "0.5.2"
 
/// Address for sending bugs
#define INCRON_BUG_ADDRESS "<bugs@aiken.cz>"
/incron/trunk/incrontab.1
1,4 → 1,4
.TH "incrontab" "1" "0.5.1" "Lukas Jelinek" "incron documentation"
.TH "incrontab" "1" "0.5.2" "Lukas Jelinek" "incron documentation"
.SH "NAME"
incrontab \- table manipulator for inotify cron (incron)
.SH "SYNOPSIS"