Subversion Repositories public

Rev

Rev 47 | Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47 Rev 49
Line 25... Line 25...
25
#include "inotify-cxx.h"
25
#include "inotify-cxx.h"
26
#include "incrontab.h"
26
#include "incrontab.h"
27
27
28
#include "usertable.h"
28
#include "usertable.h"
29
29
-
 
30
/// Daemon yes/no
30
#define DAEMON true
31
#define DAEMON true
31
32
-
 
33
/// Application name
32
#define INCRON_APP_NAME "incrond"
34
#define INCRON_APP_NAME "incrond"
-
 
35
-
 
36
/// Logging options (console as fallback, log PID)
33
#define INCRON_LOG_OPTS (LOG_CONS | LOG_PID)
37
#define INCRON_LOG_OPTS (LOG_CONS | LOG_PID)
-
 
38
-
 
39
/// Logging facility (use CRON)
34
#define INCRON_LOG_FACIL LOG_CRON
40
#define INCRON_LOG_FACIL LOG_CRON
35
41
36
42
-
 
43
/// User name to user table mapping definition
37
typedef std::map<std::string, UserTable*> SUT_MAP;
44
typedef std::map<std::string, UserTable*> SUT_MAP;
38
45
39
-
 
-
 
46
/// User name to user table mapping table
40
SUT_MAP g_ut;
47
SUT_MAP g_ut;
41
48
-
 
49
/// Finish program yes/no
42
volatile bool g_fFinish = false;
50
volatile bool g_fFinish = false;
43
51
-
 
52
44
/// Handles a signal.
53
/// Handles a signal.
45
/**
54
/**
46
 * For SIGTERM and SIGINT it sets the program finish variable.
55
 * For SIGTERM and SIGINT it sets the program finish variable.
47
 *
56
 *
48
 * \param[in] signo signal number
57
 * \param[in] signo signal number
Line 154... Line 163...
154
   
163
   
155
    InotifyEvent e;
164
    InotifyEvent e;
156
   
165
   
157
    struct pollfd pfd;
166
    struct pollfd pfd;
158
    pfd.fd = in.GetDescriptor();
167
    pfd.fd = in.GetDescriptor();
159
    pfd.events = POLLIN;
168
    pfd.events = (short) POLLIN;
160
    pfd.revents = (short) 0;
169
    pfd.revents = (short) 0;
161
   
170
   
162
    while (!g_fFinish) {
171
    while (!g_fFinish) {
163
     
172
     
164
      int res = poll(&pfd, 1, -1);
173
      int res = poll(&pfd, 1, -1);