1 diff -urNp -x '*.orig' cronie-1.5.6.org/configure.ac cronie-1.5.6/configure.ac
2 --- cronie-1.5.6.org/configure.ac 2021-03-17 16:34:06.000000000 +0100
3 +++ cronie-1.5.6/configure.ac 2021-03-20 23:36:43.706964317 +0100
4 @@ -30,7 +30,6 @@ AC_CHECK_HEADERS( \
12 @@ -119,9 +118,16 @@ AC_SUBST(DAEMON_GROUPNAME)
14 [AS_HELP_STRING([--with-inotify], [ Enable inotify support])],
15 [ if test "x$withval" != "xno" ; then
16 + AC_MSG_CHECKING([whether sys/inotify.h actually works])
18 + AC_LANG_PROGRAM([[#include <sys/inotify.h>]],
19 + [[return (-1 == inotify_init());]]
21 + [AC_MSG_RESULT([yup]); AC_DEFINE([SYS_INOTIFY_H_EXISTS_AND_WORKS],[1],[sys/inotify.h exists and works correctly])],
22 + [AC_MSG_RESULT([nope, using own inotify headers])]
25 AC_DEFINE(WITH_INOTIFY,1,[Define if you want inotify support.])
26 - AC_CHECK_HEADER([sys/inotify.h], , AC_MSG_ERROR(Inotify support requires sys/inotify.h header))
27 - AC_CHECK_FUNCS(inotify_init inotify_add_watch)
31 diff -urNp -x '*.orig' cronie-1.5.6.org/src/cron.c cronie-1.5.6/src/cron.c
32 --- cronie-1.5.6.org/src/cron.c 2021-01-22 12:29:39.000000000 +0100
33 +++ cronie-1.5.6/src/cron.c 2021-03-20 23:36:43.706964317 +0100
38 +#ifdef SYS_INOTIFY_H_EXISTS_AND_WORKS
39 # include <sys/inotify.h>
41 +#include "inotify-nosys.h"
45 #include "cronie_common.h"
46 diff -urNp -x '*.orig' cronie-1.5.6.org/src/inotify-nosys.h cronie-1.5.6/src/inotify-nosys.h
47 --- cronie-1.5.6.org/src/inotify-nosys.h 1970-01-01 01:00:00.000000000 +0100
48 +++ cronie-1.5.6/src/inotify-nosys.h 2021-03-20 23:36:43.706964317 +0100
51 + * This header is used if <sys/inotify.h> cannot be found.
53 + * Inode based directory notification for Linux
55 + * Copyright (C) 2005 John McCutchan
58 +#ifndef _LINUX_INOTIFY_H
59 +#define _LINUX_INOTIFY_H
62 +#include <sys/syscall.h>
66 + * struct inotify_event - structure read from the inotify device for each event
68 + * When you are watching a directory, you will receive the filename for events
69 + * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
71 +struct inotify_event {
72 + int wd; /* watch descriptor */
73 + uint32_t mask; /* watch mask */
74 + uint32_t cookie; /* cookie to synchronize two events */
75 + uint32_t len; /* length (including nulls) of name */
76 + char name __flexarr; /* stub for possible name */
79 +/* the following are legal, implemented events that user-space can watch for */
80 +#define IN_ACCESS 0x00000001 /* File was accessed */
81 +#define IN_MODIFY 0x00000002 /* File was modified */
82 +#define IN_ATTRIB 0x00000004 /* Metadata changed */
83 +#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
84 +#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
85 +#define IN_OPEN 0x00000020 /* File was opened */
86 +#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
87 +#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
88 +#define IN_CREATE 0x00000100 /* Subfile was created */
89 +#define IN_DELETE 0x00000200 /* Subfile was deleted */
90 +#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
91 +#define IN_MOVE_SELF 0x00000800 /* Self was moved */
93 +/* the following are legal events. they are sent as needed to any watch */
94 +#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
95 +#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
96 +#define IN_IGNORED 0x00008000 /* File was ignored */
99 +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
100 +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
103 +#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
104 +#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
105 +#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
106 +#define IN_ISDIR 0x40000000 /* event occurred against dir */
107 +#define IN_ONESHOT 0x80000000 /* only send event once */
110 + * All of the events - we build the list by hand so that we can add flags in
111 + * the future and not break backward compatibility. Apps will get only the
112 + * events that they originally wanted. Be sure to add new events here!
114 +#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
115 + IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
116 + IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
119 +#if defined (__alpha__)
120 +# define __NR_inotify_init 444
121 +# define __NR_inotify_add_watch 445
122 +# define __NR_inotify_rm_watch 446
124 +#elif defined (__arm__)
125 +# define __NR_inotify_init (__NR_SYSCALL_BASE+316)
126 +# define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
127 +# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
129 +#elif defined (__frv__)
130 +# define __NR_inotify_init 291
131 +# define __NR_inotify_add_watch 292
132 +# define __NR_inotify_rm_watch 293
134 +#elif defined(__i386__)
135 +# define __NR_inotify_init 291
136 +# define __NR_inotify_add_watch 292
137 +# define __NR_inotify_rm_watch 293
139 +#elif defined (__ia64__)
140 +# define __NR_inotify_init 1277
141 +# define __NR_inotify_add_watch 1278
142 +# define __NR_inotify_rm_watch 1279
144 +#elif defined (__mips__)
145 +# if _MIPS_SIM == _MIPS_SIM_ABI32
146 +# define __NR_inotify_init (__NR_Linux + 284)
147 +# define __NR_inotify_add_watch (__NR_Linux + 285)
148 +# define __NR_inotify_rm_watch (__NR_Linux + 286)
150 +# if _MIPS_SIM == _MIPS_SIM_ABI64
151 +# define __NR_inotify_init (__NR_Linux + 243)
152 +# define __NR_inotify_add_watch (__NR_Linux + 243)
153 +# define __NR_inotify_rm_watch (__NR_Linux + 243)
155 +# if _MIPS_SIM == _MIPS_SIM_NABI32
156 +# define __NR_inotify_init (__NR_Linux + 247)
157 +# define __NR_inotify_add_watch (__NR_Linux + 248)
158 +# define __NR_inotify_rm_watch (__NR_Linux + 249)
161 +#elif defined(__parisc__)
162 +# define __NR_inotify_init (__NR_Linux + 269)
163 +# define __NR_inotify_add_watch (__NR_Linux + 270)
164 +# define __NR_inotify_rm_watch (__NR_Linux + 271)
166 +#elif defined(__powerpc__) || defined(__powerpc64__)
167 +# define __NR_inotify_init 275
168 +# define __NR_inotify_add_watch 276
169 +# define __NR_inotify_rm_watch 277
171 +#elif defined (__s390__)
172 +# define __NR_inotify_init 284
173 +# define __NR_inotify_add_watch 285
174 +# define __NR_inotify_rm_watch 286
176 +#elif defined (__sh__)
177 +# define __NR_inotify_init 290
178 +# define __NR_inotify_add_watch 291
179 +# define __NR_inotify_rm_watch 292
181 +#elif defined (__sh64__)
182 +# define __NR_inotify_init 318
183 +# define __NR_inotify_add_watch 319
184 +# define __NR_inotify_rm_watch 320
186 +#elif defined (__sparc__) || defined (__sparc64__)
187 +# define __NR_inotify_init 151
188 +# define __NR_inotify_add_watch 152
189 +# define __NR_inotify_rm_watch 156
191 +#elif defined(__x86_64__)
192 +# define __NR_inotify_init 253
193 +# define __NR_inotify_add_watch 254
194 +# define __NR_inotify_rm_watch 255
197 +# error "Unsupported architecture!"
200 +static inline int inotify_init (void)
202 + return syscall (__NR_inotify_init);
205 +static inline int inotify_add_watch (int fd, const char *name, uint32_t mask)
207 + return syscall (__NR_inotify_add_watch, fd, name, mask);
210 +static inline int inotify_rm_watch (int fd, uint32_t wd)
212 + return syscall (__NR_inotify_rm_watch, fd, wd);
216 +#endif /* _LINUX_INOTIFY_H */