Commit Graph

50 Commits

Author SHA1 Message Date
25fe05e702 start_monitoring(): Fix incorrect assignment of 'handle_child_exits' 2024-07-08 19:02:18 +02:00
cfe2182886 Fix -e without specified exit code and fix help text 2024-07-07 23:50:41 +02:00
350c4affe5 Handle SIGCHLD in main loop
Otherwise, we call printf() etc. in the signal handler...
2024-07-07 23:50:41 +02:00
88063430ce update copyright 2024-07-07 22:20:55 +02:00
Lester Hightower
bf920a533d Fixed waitpid handling 2024-07-02 10:14:50 -04:00
Lester Hightower
5236c8d947 Reap N-number of children per SIGCHLD 2024-07-02 09:33:43 -04:00
75b7db7d36 reformat with clangformat - no functional change 2020-11-15 20:38:15 +01:00
1202296495 Add placeholder %eventmaskstr% for command args containing event string
This helps scripts to determine which events occured on the file
without having to parse the environment variable ADHOCIFYEVENT.

Add placeholder %eventfilepath% as an alternative for {}
2020-08-20 22:49:38 +02:00
d62d2956cd updated copyright... 2020-08-20 13:41:42 +02:00
da1f55e340 messages: replace "child" with "command" for clarity 2020-08-20 13:33:33 +02:00
875c176cc1 exit adhocify if command is not found irrespective of -e 2020-08-20 13:20:20 +02:00
2e77170115 Replace execv with execvp as it has the more natural behaviour 2020-08-20 11:58:18 +02:00
898e114eef Fixed error message for unsupported events 2020-08-20 00:20:52 +02:00
b7a27fbff3 capitalize event env var: adhocifyevent => ADHOCFIYEVENT 2020-08-15 23:31:41 +02:00
0d0d42cb31 Allow specifying negated exit status codes for --exit-with-child 2020-08-15 23:19:14 +02:00
519afe63d1 xrealpath: give more user-friendly error messages 2020-08-15 22:33:35 +02:00
0e75740630 make daemonizing the last step in command processing 2020-08-07 23:15:40 +02:00
6b1356b65b improve help text 2020-08-07 23:12:07 +02:00
27fdabc591 fixed --exit-with-child 2019-04-27 23:00:12 +02:00
4d7bde2773 remove clang warning: better check for whether name field is empty 2017-08-12 16:10:47 +02:00
7f55924649 remove obsolete unused counter 2017-07-28 09:01:53 +02:00
b9a638d43f get_eventfile_abspath(): minor improvement: get rid of strcpy etc. 2017-07-28 08:55:53 +02:00
bd9bcd8752 Remove -r: It's existence cannot be justified
We already have -s to read from stdin, there is no point to
walk paths ourselves.

find . -type d | adhocify -s [path to script] is pretty much the same.
2017-07-27 22:10:49 +02:00
68c67aa5e8 set argv[0] even if we do not pass anything else to the script 2017-03-19 09:53:04 +01:00
db4154a0d1 fixed typos 2016-08-21 15:48:59 +02:00
200d7ba8cb -r: check against max number of watches 2016-05-23 18:24:51 +02:00
be91bb8473 add a little warning for -r 2016-05-23 18:07:04 +02:00
4d6d58d7bf rename: watchpath_addpath -> watchpath_add_path 2016-05-23 18:04:53 +02:00
a45a7a9acf add basic recursive watch support 2016-05-23 17:54:02 +02:00
58db52dfc9 usage text: document -e 2016-01-02 14:23:20 +01:00
68c11d296b formating 2015-10-12 22:40:36 +02:00
8b668be219 better function name 2015-05-11 12:33:10 +02:00
8304fdf2ab fixed wrong bit returned for IN_MOVE_SELF 2015-01-06 20:19:00 +01:00
2033102e40 Implemented -e: exit adhocify if child exits with specified return code 2014-12-20 20:11:51 +01:00
daec97f2b3 Licence: ISC 2014-10-22 00:31:17 +02:00
252df6f648 corrected perror value in run_prog 2014-10-21 23:51:37 +02:00
a8db2df993 Prepare the script arguments when we process adhocify's arguments.
This way all children don't have to do the same work all and over again.
They only need to replace {}.
2014-10-21 23:41:53 +02:00
9c29c163c1 Added support for user specified script arguments 2014-10-10 15:52:01 +02:00
781b702d7d use sizeof instead of hardcoded value 2014-10-10 15:09:49 +02:00
02edbf8e44 Refactoring. 2014-04-11 19:46:09 +02:00
fda61d7522 memory leak killed ; codestyle 2014-03-05 18:22:12 +01:00
eadd46583b Several changes:
-use access() to check for existince of file
-check in main() whether prog exists, not just before running it
-helptext: tabs
-Variables which values are specified by argv-options moved to global
scope. They are write-once and don't need to be passed around all the
time.
2013-12-16 21:13:07 +01:00
7149d0d028 fixed potential overflow :) 2013-09-30 20:10:22 +02:00
0fb49ec91f no need to xmalloc envvar 2013-09-30 19:56:11 +02:00
29794f9b99 Bugfix: read from stdin before we check whether we got somem entries... 2013-09-30 19:45:48 +02:00
47a8301190 added longoptions 2013-09-21 20:45:10 +02:00
dc8af94194 added usage print, tiny improvements throughout the code 2013-08-29 14:41:55 +02:00
58f2a92a4e Ignore implemented 2013-06-12 22:55:30 +02:00
771327286e Several improvements ; WIP ignore option 2013-06-12 22:38:52 +02:00
9fe3d63b83 First commit 2013-04-21 22:36:59 +02:00