void SetReferenceTime(EvalContext *ctx, int setclasses) { time_t tloc; char vbuff[CF_BUFSIZE]; if ((tloc = time((time_t *) NULL)) == -1) { Log(LOG_LEVEL_ERR, "Couldn't read system clock. (time: %s)", GetErrorStr()); } CFSTARTTIME = tloc; snprintf(vbuff, CF_BUFSIZE, "%s", ctime(&tloc)); Log(LOG_LEVEL_VERBOSE, "Reference time set to '%s'", ctime(&tloc)); if (setclasses) { RemoveTimeClass(ctx, tloc); AddTimeClass(ctx, tloc); } }
void SetReferenceTime(EvalContext *ctx, int setclasses) { time_t tloc; char vbuff[CF_BUFSIZE]; if ((tloc = time((time_t *) NULL)) == -1) { CfOut(OUTPUT_LEVEL_ERROR, "time", "Couldn't read system clock\n"); } CFSTARTTIME = tloc; snprintf(vbuff, CF_BUFSIZE, "%s", cf_ctime(&tloc)); CfOut(OUTPUT_LEVEL_VERBOSE, "", "Reference time set to %s\n", cf_ctime(&tloc)); if (setclasses) { RemoveTimeClass(ctx, tloc); AddTimeClass(ctx, tloc); } }
void UpdateTimeClasses(EvalContext *ctx, time_t t) { RemoveTimeClass(ctx, t); AddTimeClass(ctx, t); }
void UpdateTimeClasses(EvalContext *ctx, time_t t) { RemoveTimeClass(ctx, "cfengine_internal_time_based_autoremove"); AddTimeClass(ctx, t, "time_based,cfengine_internal_time_based_autoremove,source=agent"); }