Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cf-agent/files_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
copy equal to the copied template file - not the
copied + edited file. */

/* The ifelapsed of the promises of edit bundles: CF_EDIT_IFELAPSED, unless the
* default ifelapsed is lower, e.g. 0 for the bundles cf-reactor runs on events,
* which may happen less than a minute apart */
#define EDIT_IFELAPSED MIN(CF_EDIT_IFELAPSED, VIFELAPSED)

typedef struct
{
char *filename;
Expand Down
8 changes: 4 additions & 4 deletions cf-agent/files_editline.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ static PromiseResult VerifyLineDeletions(EvalContext *ctx, const Promise *pp, Ed
char lockname[CF_BUFSIZE];

Attributes a = GetDeletionAttributes(ctx, pp);
a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

if (!SanityCheckDeletions(&a, pp))
{
Expand Down Expand Up @@ -453,7 +453,7 @@ static PromiseResult VerifyColumnEdits(EvalContext *ctx, const Promise *pp, Edit
char lockname[CF_BUFSIZE];

Attributes a = GetColumnAttributes(ctx, pp);
a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

if (a.column.column_separator == NULL)
{
Expand Down Expand Up @@ -547,7 +547,7 @@ static PromiseResult VerifyPatterns(EvalContext *ctx, const Promise *pp, EditCon
/* Are we working in a restricted region? */

Attributes a = GetReplaceAttributes(ctx, pp);
a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

if (!a.replace.replace_value)
{
Expand Down Expand Up @@ -733,7 +733,7 @@ static PromiseResult VerifyLineInsertions(EvalContext *ctx, const Promise *pp, E

Attributes a = GetInsertionAttributes(ctx, pp);
int allow_multi_lines = StringEqual(a.sourcetype, "preserve_all_lines");
a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

if (!SanityCheckInsertions(&a))
{
Expand Down
16 changes: 8 additions & 8 deletions cf-agent/files_editxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static bool VerifyXPathBuild(EvalContext *ctx, const Attributes *attr, const Pro
CfLock thislock;
char lockname[CF_BUFSIZE], rawxpath[CF_BUFSIZE] = { 0 };

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

int ret = snprintf(rawxpath, sizeof(rawxpath), "%s",
a.xml.havebuildxpath ? a.xml.build_xpath : pp->promiser);
Expand Down Expand Up @@ -417,7 +417,7 @@ static PromiseResult VerifyTreeDeletions(EvalContext *ctx, const Attributes *att
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

if (!SanityCheckTreeDeletions(&a))
{
Expand Down Expand Up @@ -497,7 +497,7 @@ static PromiseResult VerifyTreeInsertions(EvalContext *ctx, const Attributes *at
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

PromiseResult result = PROMISE_RESULT_NOOP;
if (!SanityCheckTreeInsertions(&a, edcontext))
Expand Down Expand Up @@ -590,7 +590,7 @@ static PromiseResult VerifyAttributeDeletions(EvalContext *ctx, const Attributes
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

PromiseResult result = PROMISE_RESULT_NOOP;
if (!SanityCheckAttributeDeletions(&a))
Expand Down Expand Up @@ -673,7 +673,7 @@ static PromiseResult VerifyAttributeSet(EvalContext *ctx, const Attributes *attr
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

PromiseResult result = PROMISE_RESULT_NOOP;
if (!SanityCheckAttributeSet(&a))
Expand Down Expand Up @@ -756,7 +756,7 @@ static PromiseResult VerifyTextDeletions(EvalContext *ctx, const Attributes *att
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

PromiseResult result = PROMISE_RESULT_NOOP;
if (!SanityCheckTextDeletions(&a))
Expand Down Expand Up @@ -839,7 +839,7 @@ static PromiseResult VerifyTextSet(EvalContext *ctx, const Attributes *attr, con
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

PromiseResult result = PROMISE_RESULT_NOOP;
if (!SanityCheckTextSet(&a))
Expand Down Expand Up @@ -922,7 +922,7 @@ static PromiseResult VerifyTextInsertions(EvalContext *ctx, const Attributes *at
CfLock thislock;
char lockname[CF_BUFSIZE];

a.transaction.ifelapsed = CF_EDIT_IFELAPSED;
a.transaction.ifelapsed = EDIT_IFELAPSED;

PromiseResult result = PROMISE_RESULT_NOOP;
if (!SanityCheckTextInsertions(&a))
Expand Down
Loading
Loading