~arges/ubuntu/quantal/rsyslog/fix-lp1059592

« back to all changes in this revision

Viewing changes to plugins/immark/immark.c

Tags: 5.7.3-1
* New upstream release.
* Upload to unstable.
* debian/patches/02-typo_fix_equation_sign.patch
  - Removed, merged upstream.
* debian/patches/03-atomic_operations.patch
  - Removed, merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include "module-template.h"
43
43
#include "errmsg.h"
44
44
#include "msg.h"
 
45
#include "srUtils.h"
 
46
#include "glbl.h"
45
47
 
46
48
MODULE_TYPE_INPUT
47
49
 
50
52
 
51
53
/* Module static data */
52
54
DEF_IMOD_STATIC_DATA
 
55
DEFobjCurrIf(glbl)
53
56
static int iMarkMessagePeriod = DEFAULT_MARK_PERIOD;
54
57
 
 
58
BEGINisCompatibleWithFeature
 
59
CODESTARTisCompatibleWithFeature
 
60
        if(eFeat == sFEATURENonCancelInputTermination)
 
61
                iRet = RS_RET_OK;
 
62
ENDisCompatibleWithFeature
 
63
 
 
64
 
55
65
/* This function is called to gather input. It must terminate only
56
66
 * a) on failure (iRet set accordingly)
57
67
 * b) on termination of the input module (as part of the unload process)
71
81
         * right into the sleep below.
72
82
         */
73
83
        while(1) {
74
 
                /* we do not need to handle the RS_RET_TERMINATE_NOW case any
75
 
                 * special because we just need to terminate. This may be different
76
 
                 * if a cleanup is needed. But for now, we can just use CHKiRet().
77
 
                 * rgerhards, 2007-12-17
78
 
                 */
79
 
                CHKiRet(thrdSleep(pThrd, iMarkMessagePeriod, 0)); /* seconds, micro seconds */
 
84
                srSleep(iMarkMessagePeriod, 0); /* seconds, micro seconds */
 
85
 
 
86
                if(glbl.GetGlobalInputTermState() == 1)
 
87
                        break; /* terminate input! */
 
88
 
80
89
                logmsgInternal(NO_ERRCODE, LOG_INFO, (uchar*)"-- MARK --", MARK);
81
90
        }
82
 
finalize_it:
83
 
        return iRet;
84
91
ENDrunInput
85
92
 
86
93
 
106
113
BEGINqueryEtryPt
107
114
CODESTARTqueryEtryPt
108
115
CODEqueryEtryPt_STD_IMOD_QUERIES
 
116
CODEqueryEtryPt_IsCompatibleWithFeature_IF_OMOD_QUERIES
109
117
ENDqueryEtryPt
110
118
 
111
119
static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal)
119
127
CODESTARTmodInit
120
128
        *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
121
129
CODEmodInit_QueryRegCFSLineHdlr
 
130
        CHKiRet(objUse(glbl, CORE_COMPONENT));
122
131
        CHKiRet(omsdRegCFSLineHdlr((uchar *)"markmessageperiod", 0, eCmdHdlrInt, NULL, &iMarkMessagePeriod, STD_LOADABLE_MODULE_ID));
123
132
        CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID));
124
133
ENDmodInit
125
 
/*
126
 
 * vi:set ai:
 
134
/* vi:set ai:
127
135
 */