Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 162346
Collapse All | Expand All

(-)incron-0.4.0/Makefile (-5 / +11 lines)
Lines 1-8 Link Here
1
1
2
PREFIX = /usr/local
2
PREFIX = $(DESTDIR)usr
3
USERDATADIR = /var/spool/incron
3
USERDATADIR = $(DESTDIR)var/spool/incron
4
SYSDATADIR = /etc/incron.d
4
SYSDATADIR = $(DESTDIR)etc/incron.d
5
MANPATH = /usr/share/man
5
MANPATH = $(DESTDIR)usr/share/man
6
INITDIR = $(DESTDIR)etc/init.d
6
RELEASE = incron-`cat VERSION`
7
RELEASE = incron-`cat VERSION`
7
RELEASEDIR = /tmp/$(RELEASE)
8
RELEASEDIR = /tmp/$(RELEASE)
8
9
Lines 15-24 Link Here
15
DEBUG = -g0
16
DEBUG = -g0
16
WARNINGS = -Wall
17
WARNINGS = -Wall
17
CXXAUX = -pipe
18
CXXAUX = -pipe
19
LDFLAGS += -Wl,-z,now
18
20
19
CPPFLAGS = 
21
CPPFLAGS = 
20
CXXFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS) $(CXXAUX)
22
CXXFLAGS = $(OPTIMIZE) $(DEBUG) $(WARNINGS) $(CXXAUX)
21
LDFLAGS = $(WARNINGS)
23
LDFLAGS += $(WARNINGS)
22
24
23
PROGRAMS = incrond incrontab
25
PROGRAMS = incrond incrontab
24
26
Lines 45-52 Link Here
45
47
46
install:	all install-man
48
install:	all install-man
47
	[ -d $(PREFIX) ]
49
	[ -d $(PREFIX) ]
50
	$(INSTALL) -m 0755 -d $(PREFIX)/bin
51
	$(INSTALL) -m 0755 -d $(PREFIX)/sbin
52
	$(INSTALL) -m 0755 -d $(INITDIR)/
48
	$(INSTALL) -m 04755 -o $(USER) incrontab $(PREFIX)/bin/
53
	$(INSTALL) -m 04755 -o $(USER) incrontab $(PREFIX)/bin/
49
	$(INSTALL) -m 0755 incrond $(PREFIX)/sbin/
54
	$(INSTALL) -m 0755 incrond $(PREFIX)/sbin/
55
	$(INSTALL) -m 0755 incrond-init.d $(INITDIR)/incrond
50
	$(INSTALL) -m 0755 -o $(USER) -d $(USERDATADIR)
56
	$(INSTALL) -m 0755 -o $(USER) -d $(USERDATADIR)
51
	$(INSTALL) -m 0755 -o $(USER) -d $(SYSDATADIR)
57
	$(INSTALL) -m 0755 -o $(USER) -d $(SYSDATADIR)
52
58
(-)incron-0.4.0/incrond-init.d (+22 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2004 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header:  $
5
6
7
depend() {
8
	need localmount
9
	use logger
10
}
11
12
start() {
13
	ebegin "Starting incrond"
14
	/usr/sbin/incrond 
15
	eend ${?}
16
}
17
18
stop() {
19
	ebegin "Stopping incrond"
20
	/usr/sbin/incrond -k
21
	eend ${?}
22
}
(-)incron-0.4.0/inotify-cxx.h (-2 / +2 lines)
Lines 32-42 Link Here
32
32
33
// Please ensure that the following headers take the right place
33
// Please ensure that the following headers take the right place
34
#include <sys/syscall.h>
34
#include <sys/syscall.h>
35
#include <sys/inotify.h>
35
//#include <sys/inotify.h>
36
36
37
// Use this if syscalls not defined
37
// Use this if syscalls not defined
38
#ifndef __NR_inotify_init
38
#ifndef __NR_inotify_init
39
#include <sys/inotify-syscalls.h>
39
#include "inotify-nosys.h"
40
#endif // __NR_inotify_init
40
#endif // __NR_inotify_init
41
41
42
/// Event struct size
42
/// Event struct size
(-)incron-0.4.0/inotify-nosys.h (+167 lines)
Line 0 Link Here
1
/*
2
 * This header is used if <sys/inotify.h> cannot be found.
3
 *
4
 * Inode based directory notification for Linux
5
 *
6
 * Copyright (C) 2005 John McCutchan
7
 */
8
9
#ifndef _LINUX_INOTIFY_H
10
#define _LINUX_INOTIFY_H
11
12
#include <stdint.h>
13
#include <sys/syscall.h>
14
#include <unistd.h>
15
16
/*
17
 * struct inotify_event - structure read from the inotify device for each event
18
 *
19
 * When you are watching a directory, you will receive the filename for events
20
 * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
21
 */
22
struct inotify_event {
23
	int		wd;		/* watch descriptor */
24
	uint32_t		mask;		/* watch mask */
25
	uint32_t		cookie;		/* cookie to synchronize two events */
26
	uint32_t		len;		/* length (including nulls) of name */
27
	char		name __flexarr;	/* stub for possible name */
28
};
29
30
/* the following are legal, implemented events that user-space can watch for */
31
#define IN_ACCESS		0x00000001	/* File was accessed */
32
#define IN_MODIFY		0x00000002	/* File was modified */
33
#define IN_ATTRIB		0x00000004	/* Metadata changed */
34
#define IN_CLOSE_WRITE		0x00000008	/* Writtable file was closed */
35
#define IN_CLOSE_NOWRITE	0x00000010	/* Unwrittable file closed */
36
#define IN_OPEN			0x00000020	/* File was opened */
37
#define IN_MOVED_FROM		0x00000040	/* File was moved from X */
38
#define IN_MOVED_TO		0x00000080	/* File was moved to Y */
39
#define IN_CREATE		0x00000100	/* Subfile was created */
40
#define IN_DELETE		0x00000200	/* Subfile was deleted */
41
#define IN_DELETE_SELF		0x00000400	/* Self was deleted */
42
#define IN_MOVE_SELF		0x00000800	/* Self was moved */
43
44
/* the following are legal events.  they are sent as needed to any watch */
45
#define IN_UNMOUNT		0x00002000	/* Backing fs was unmounted */
46
#define IN_Q_OVERFLOW		0x00004000	/* Event queued overflowed */
47
#define IN_IGNORED		0x00008000	/* File was ignored */
48
49
/* helper events */
50
#define IN_CLOSE		(IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
51
#define IN_MOVE			(IN_MOVED_FROM | IN_MOVED_TO) /* moves */
52
53
/* special flags */
54
#define IN_ONLYDIR		0x01000000	/* only watch the path if it is a directory */
55
#define IN_DONT_FOLLOW		0x02000000	/* don't follow a sym link */
56
#define IN_MASK_ADD		0x20000000	/* add to the mask of an already existing watch */
57
#define IN_ISDIR		0x40000000	/* event occurred against dir */
58
#define IN_ONESHOT		0x80000000	/* only send event once */
59
60
/*
61
 * All of the events - we build the list by hand so that we can add flags in
62
 * the future and not break backward compatibility.  Apps will get only the
63
 * events that they originally wanted.  Be sure to add new events here!
64
 */
65
#define IN_ALL_EVENTS	(IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
66
			 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
67
			 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
68
			 IN_MOVE_SELF)
69
70
#if defined (__alpha__)
71
# define __NR_inotify_init 444
72
# define __NR_inotify_add_watch 445
73
# define __NR_inotify_rm_watch 446
74
75
#elif defined (__arm__)
76
# define __NR_inotify_init (__NR_SYSCALL_BASE+316)
77
# define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
78
# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
79
80
#elif defined (__frv__)
81
# define __NR_inotify_init 291
82
# define __NR_inotify_add_watch 292
83
# define __NR_inotify_rm_watch 293
84
85
#elif defined(__i386__)
86
# define __NR_inotify_init 291
87
# define __NR_inotify_add_watch 292
88
# define __NR_inotify_rm_watch 293
89
90
#elif defined (__ia64__)
91
# define __NR_inotify_init 1277
92
# define __NR_inotify_add_watch 1278
93
# define __NR_inotify_rm_watch 1279
94
95
#elif defined (__mips__)
96
# if _MIPS_SIM == _MIPS_SIM_ABI32
97
#  define __NR_inotify_init (__NR_Linux + 284)
98
#  define __NR_inotify_add_watch (__NR_Linux + 285)
99
#  define __NR_inotify_rm_watch (__NR_Linux + 286)
100
# endif
101
# if _MIPS_SIM == _MIPS_SIM_ABI64
102
#  define __NR_inotify_init (__NR_Linux + 243)
103
#  define __NR_inotify_add_watch (__NR_Linux + 243)
104
#  define __NR_inotify_rm_watch (__NR_Linux + 243)
105
# endif
106
# if _MIPS_SIM == _MIPS_SIM_NABI32
107
#  define __NR_inotify_init (__NR_Linux + 247)
108
#  define __NR_inotify_add_watch (__NR_Linux + 248)
109
#  define __NR_inotify_rm_watch (__NR_Linux + 249)
110
# endif
111
112
#elif defined(__parisc__)
113
# define __NR_inotify_init (__NR_Linux + 269)
114
# define __NR_inotify_add_watch (__NR_Linux + 270)
115
# define __NR_inotify_rm_watch (__NR_Linux + 271)
116
117
#elif defined(__powerpc__) || defined(__powerpc64__)
118
# define __NR_inotify_init 275
119
# define __NR_inotify_add_watch 276
120
# define __NR_inotify_rm_watch 277
121
122
#elif defined (__s390__)
123
# define __NR_inotify_init 284
124
# define __NR_inotify_add_watch 285
125
# define __NR_inotify_rm_watch 286
126
127
#elif defined (__sh__)
128
# define __NR_inotify_init 290
129
# define __NR_inotify_add_watch 291
130
# define __NR_inotify_rm_watch 292
131
132
#elif defined (__sh64__)
133
# define __NR_inotify_init 318
134
# define __NR_inotify_add_watch 319
135
# define __NR_inotify_rm_watch 320
136
137
#elif defined (__sparc__) || defined (__sparc64__)
138
# define __NR_inotify_init 151
139
# define __NR_inotify_add_watch 152
140
# define __NR_inotify_rm_watch 156
141
142
#elif defined(__x86_64__)
143
# define __NR_inotify_init 253
144
# define __NR_inotify_add_watch 254
145
# define __NR_inotify_rm_watch 255
146
147
#else
148
# error "Unsupported architecture!"
149
#endif
150
151
static inline int inotify_init (void)
152
{
153
	return syscall (__NR_inotify_init);
154
}
155
156
static inline int inotify_add_watch (int fd, const char *name, uint32_t mask)
157
{
158
	return syscall (__NR_inotify_add_watch, fd, name, mask);
159
}
160
161
static inline int inotify_rm_watch (int fd, uint32_t wd)
162
{
163
	return syscall (__NR_inotify_rm_watch, fd, wd);
164
}
165
166
167
#endif	/* _LINUX_INOTIFY_H */

Return to bug 162346