Repository navigation
Conversation
Moved from a hardcoded and single `file_deleted` event type, to a table with all the event types and their necessary code, so that cf-reactor can easiky be extended with new event types. Ticket: ENT-14692 Signed-off-by: Victor Moene <victor.moene@northern.tech>
Signed-off-by: Victor Moene <victor.moene@northern.tech>
1. file_created: the file appears at the path. 2. file_modified: the modification time of the file changes. 3. file_content_modified: the SHA-256 hash of a regular file's content changes. 4. file_permissions_changed: the permission bits (07777) change. 5. file_owner_changed: the owning user or group changes. 6. file_replaced: the path now points to a different file (another inode or device), for example after an atomic rename over it. 7. file_type_changed: the file's type changes, for example a regular file replaced by a directory or a symlink. 8. symlink_target_changed: the target of a symlink changes. 9. file_size_exceeds: the size grows above size_threshold bytes. This requires the extra size_threshold constraint. Ticket: ENT-14692 Signed-off-by: Victor Moene <victor.moene@northern.tech>
| { | ||
| assert(args != NULL && args->next != NULL); | ||
| const char *path = RlistScalarValue(args); | ||
| const long size_threshold = IntFromString(RlistScalarValue(args->next)); |
| ThreadUnlock(&watchers_mutex); | ||
| opt.destroy_state(opt.state); | ||
| return; | ||
| opt->destroy_state(opt->state); |
| ThreadUnlock(&watchers_mutex); | ||
| opt.destroy_state(opt.state); | ||
| return; | ||
| opt->destroy_state(opt->state); |
| w->promise = pp->org_pp; | ||
| w->promiser = xstrdup(pp->promiser); | ||
| w->poll_interval_secs = interval; | ||
| w->poll_interval_secs = opt->interval; |
| w->last_check = WATCHER_CHECK_NO_EVENT; | ||
| w->check_callback = opt.check_callback; | ||
| w->destroy_state = opt.destroy_state; | ||
| w->check_callback = opt->check_callback; |
| w->check_callback = opt.check_callback; | ||
| w->destroy_state = opt.destroy_state; | ||
| w->check_callback = opt->check_callback; | ||
| w->destroy_state = opt->destroy_state; |
| if (prev == NULL) | ||
| { | ||
| w->state = opt.state; | ||
| w->state = opt->state; |
| w->state = prev->state; | ||
| prev->state = NULL; /* so not destroyed with prev */ | ||
| opt.destroy_state(opt.state); | ||
| opt->destroy_state(opt->state); |
| w->state = prev->state; | ||
| prev->state = NULL; /* so not destroyed with prev */ | ||
| opt.destroy_state(opt.state); | ||
| opt->destroy_state(opt->state); |
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.
No description provided.