Integrate out of tree development of watchtower#104
Merged
Conversation
Signed-off-by: Joel Savitz <jsavitz@redhat.com> Upstream-commit: f2d00d8ae6669a3ad1c0abee58c32ff6670c87ed
Signed-off-by: Joel Savitz <jsavitz@redhat.com> Upstream-commit: 083f7a46cf526b0d75dda5e5126b6e538102fb6b
Signed-off-by: Joel Savitz <jsavitz@redhat.com> Upstream-commit: 04a2db0b15b123953d02e1ba04e64b74d313d7f2
Signed-off-by: Joel Savitz <jsavitz@redhat.com> Upstream-commit: 768850d5e059d0d84bf820f2f2e47e1eec9313ae
Signed-off-by: Joel Savitz <jsavitz@redhat.com> Upstream-commit: 98a35c307ffa00f74c90299d89a6cb1e6b8027a9
Upstream-commit: 11a9e8b6c5274e9aa088082f48bad267a5e728a6
Upstream-commit: 270698245fe3778ca4e320bd0d14023fa5e8d355
Signed-off-by: Joel Savitz <jsavitz@redhat.com> Upstream-commit: f96c5784357ab341904d99a22cbebc8b356a37ad
This silences warning about it being an unused variable since we aren't using it in either program. Upstream-commit: 3e76658cdbc1f97d874ee2c8b69e1ad60031c80a
Watch uses inotify instead of timerfd. The old header was clearly a result of copy paste. Upstream-commit: 409a2377be9534bed80c520a621289f3f9d699d1
added a makefile that compiles both programs Upstream-commit: 6723f19092bf2590716ed4099bf7b41e4c85e6e0
Upstream-commit: 90548bd527a8c742ce75d7cf6686df3082d472db
Upstream-commit: 4aa66f26f961d4b03f44542ff2ee8d226a21debc
using fread and relying on libc to use a suitably large buffer when trying to read from the inotifyfd doesn't work on musl which tries to cleverly use `readv` in its stdio implementation to avoid a copy within userspace. We can just avoid that by invoking `read` directly and implementing our own buffering logic that walks through the returned data before asking the kernel for more. Upstream-commit: 56d8ce565932f326874b9e73e783ff3e8d3aa07c
We don't need to watch more than on directory. If we really wanted to do that, we could just spawn more than one of these programs. Upstream-commit: e4e97688d8cb3bb1abe5af7ee39b23c0386c8082
We don't really care about their exit status, and if they take a long time to run, we might miss events on our file descriptor. Upstream-commit: def18c38d4b279e396cda41f7063c6e548c5cc78
These two didn't need to be a single if statment. Combining them made the code harder to follow, and the error message less specific. Upstream-commit: e566b3e668f3814e908f7f021710cb634bffb4d9
we don't need the variable named now at all, it just makes things more confusing, and needing to update it in two places is not DRY. Upstream-commit: 444df49a3267920dc3739cf7aec54045561327c4
We can just spawn more than one of these programs if we want to wait for more than one timestamp. Removes the precondition that the timestamps are sorted too. Upstream-commit: 5ef126898607be7ef9b69be8a6f72251a0560812
Since there is only one timestamp, we can just exec the program in the main pid when the time passes. Upstream-commit: 517728b7b13766c60ce5ebadfd0b3792fd469f68
Since intmax_t and time_t are actually probably both signed 64 bit ints the cast isn't enough to catch range errors. We also need to check if strtoimax returned a max or min value, and if it did, if it set errno. Upstream-commit: 12217fd98d0892d6d43924f792f3cc947c0ee276
Upstream-commit: 3247d9e97299cbc3ac55f0757e1f4a94b7fafecb
Inspired by the kernel one, but with the modern line limit of 100 and some cruft like the kernel specific list of `for-each` macros removed. Only a few tweaks needed to bring the code into compliance. Upstream-commit: e9edcaeb8cbf1e8cd14d40a95b7a09f03d9f8a0b
now that we only take one timestamp, we can allow more than just one argument afterwards and forward subsequent values after the script name as its arguments. Upstream-commit: 98175aa00b5611b59a9160556344e506d19d29dc
watch conflicts with a common builtin command, and `due` makes less sense when it only takes one timestamp. Upstream-commit: 44b82b3302285914165a8ae2bf2d51488a382cbf
The switch statement lacked a default case, so add one that simply breaks. No functional change. Signed-off-by: Joel Savitz <jsavitz@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Several useful programs were developed in an different repository. This merge brings them and their full history into the monorepo. All of the commits have been rewritten to include the
watchtowerprefix, and to move their contents into thewatchtower/subdirectory, but are otherwise unaltered. A trailer is included with the original upstream sha hash.