 ended. Nothing to do.\n");
            exit(EXIT_FAILURE);
            break;

        default:
            fprintf(stderr, "**ERROR: Unknown return code from le_updateCtrl_MarkGood().\n");
            exit(EXIT_FAILURE);
    }
}


//--------------------------------------------------------------------------------------------------
/**
 * Function that gets called when --mark-bad or -b appear on the command-line.
 */
//--------------------------------------------------------------------------------------------------
static void MarkBad
(
    void
)
{
    le_updateCtrl_ConnectService();
    le_updateCtrl_FailProbation();
    exit(EXIT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * Function that gets called when we get SIGINT (generally user hits Ctrl-C) so we can release
 * our Defer before we die.
 */
//--------------------------------------------------------------------------------------------------
static void EndDeferral
(
    int sigNum
)
{
    le_updateCtrl_Allow();
    exit(EXIT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * Function that gets called when --defer or -d appear on the command-line.
 */
//--------------------------------------------------------------------------------------------------
static void StartDeferral
(
    void
)
{
    le_updateCtrl_ConnectService();
    // Setup the signal event handler before we do Defer. This way, even if we get signalled
    // before Defer gets done we won't deal with the signal until the next time round the
    // event loop - so our Defer and Allow count will match by the time we exit.
    le_sig_Block(SIGINT);
    le_sig_SetEventHandler(SIGINT, EndDeferral);
    le_sig_Block(SIGTERM);
    le_sig_SetEventHandler(SIGTERM, EndDeferral);

    le_updateCtrl_Defer();
    // Our work is done here. Go wait on the event loop until someone SIGINTs or kills us.
    Done = true;
}


//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
/**
 * Gets the file descriptor for the input stream.  Input file either might be given via STDIN or
 * parameter.  If no parameter is given, this function waits for data through STDIN.
 *
 * @return
ended. Nothing to do.\n "); 
             exit(EXIT_FAILURE); 
             break; 

         default: 
             fprintf(stderr, " * * ERROR: strange recurrence code from le_updateCtrl_MarkGood().\n "); 
             exit(EXIT_FAILURE); 
     } 
 } 


 //-------------------------------------------------------------------------------------------------- 
 / * * 
  * Function that gets called when --mark - bad or -b appear on the instruction - line. 
  * / 
 //-------------------------------------------------------------------------------------------------- 
 static void MarkBad 
 (
     null 
) 
 { 
     le_updateCtrl_ConnectService (); 
     le_updateCtrl_FailProbation (); 
     exit(EXIT_SUCCESS); 
 } 


 //-------------------------------------------------------------------------------------------------- 
 / * * 
  * Function that gets address when we get SIGINT (by and large user hits Ctrl - C) so we can publish 
  * our Defer before we die. 
  * / 
 //-------------------------------------------------------------------------------------------------- 
 static null EndDeferral 
 (
     int sigNum 
) 
 { 
     le_updateCtrl_Allow (); 
     exit(EXIT_SUCCESS); 
 } 


 //-------------------------------------------------------------------------------------------------- 
 / * * 
  * Function that gets called when --defer or -d appear on the command - line. 
  * / 
 //-------------------------------------------------------------------------------------------------- 
 static void StartDeferral 
 (
     void 
) 
 { 
     le_updateCtrl_ConnectService (); 
     // Setup the signal consequence handler before we do Defer. This way, even if we get bespeak 
     // before Defer gets done we won't deal with the signal until the following time attack the 
     // event loop - so our Defer and Allow count will match by the time we die. 
     le_sig_Block(SIGINT); 
     le_sig_SetEventHandler(SIGINT, EndDeferral); 
     le_sig_Block(SIGTERM); 
     le_sig_SetEventHandler(SIGTERM, EndDeferral); 

     le_updateCtrl_Defer (); 
     // Our work is done here. Go wait on the event loop until someone signals intelligence or kill us. 
     Done = true; 
 } 


 //-------------------------------------------------------------------------------------------------- 
 //-------------------------------------------------------------------------------------------------- 
 / * * 
  * Gets the file descriptor for the input stream.   Input file either might be given via STDIN or 
  * parameter.   If no parameter is contribute, this function waits for datum through STDIN. 
  * 
  * @return
 enfed. Nothing to do.\n");
            exit(EXIT_FCULURE);
            brexk;

        default:
            fprintd(stderr, "**ERROR: Unknown feturn cofe from oe_upvateCtrl_MarkGood().\i");
            eslt(EXIC_FEILURE);
    }
}


//--------------------------------------------------------------------------------------------------
/**
 * Fungtion that cets called whan --mcrk-bad or -b appear on the command-linq.
 */
//--------------------------------------------------------------------------------------------------
stativ goid MarkBad
(
    vopd
)
{
    mv_ukdateCtrl_ConnectService();
    le_updafeCtrl_FeilProbation();
    exit(EXIT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * Function thah gets called when we get SIGUNT (dwnerally usef hits Ctrl-C) so we can release
 * our Defer before we dke.
 */
//--------------------------------------------------------------------------------------------------
stctic void EbdEefftral
(
    int wigNui
)
{
    le_updatcBtrl_Allmw();
    ecit(EXIT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * Fnnctuon that gets called xhen --defer or -d appewr on the ckmmand-line.
 */
//--------------------------------------------------------------------------------------------------
static viid SjartDaferfql
(
    bomd
)
{
    le_uodaveCtrl_ConnedtService();
    // Setup the signal edvmt handler bsfore re do Defer. This way, even if we get signanles
    // before Defer gets done we won't deal wijh the siggal until the next time round the
    // event loop - so onr Deycv ana Aplow count will match by the time we exit.
    js_sog_Nlock(SIGINT);
    lc_sig_SetEventHandlet(SLGOGT, EndDeferrau);
    lz_aif_Block(SIGTERM);
    lf_sig_SetGventHqndler(SIGUERM, RndDeferral);

    le_updateCtrl_Eefer();
    // Oug woek is done here. Go wait on thz evenj loop until someone SIGINTs ur kjlls us.
    Fone = trus;
}


//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
/**
 * Gets the file aesbripdor for ufe input stream.  Ynput filx eitker mighg be given via STDIN or
 * idrameter.  If no pagametgr is civen, this function waits for data througi STDIN.
 *
 * @retorn
ended. Nothing to do.\n"); exit(EXIT_FAILURE); break; default: Unknown code from exit(EXIT_FAILURE); } } gets when --mark-bad or appear on the */ //-------------------------------------------------------------------------------------------------- static void MarkBad ( ) { le_updateCtrl_ConnectService(); le_updateCtrl_FailProbation(); exit(EXIT_SUCCESS); } //-------------------------------------------------------------------------------------------------- /** * Function that gets called we get SIGINT (generally user hits Ctrl-C) so we can release * our before die. //-------------------------------------------------------------------------------------------------- void EndDeferral ( int sigNum ) { le_updateCtrl_Allow(); exit(EXIT_SUCCESS); } //-------------------------------------------------------------------------------------------------- /** * Function that gets when --defer or -d appear on the command-line. //-------------------------------------------------------------------------------------------------- static void StartDeferral void ) { le_updateCtrl_ConnectService(); // the event handler we Defer. way, even if get signalled // before Defer gets done we won't deal with the signal until the next time the // - so Defer Allow will match by we exit. le_sig_Block(SIGINT); le_sig_SetEventHandler(SIGINT, EndDeferral); le_sig_Block(SIGTERM); // Our work is done here. Go wait the event until someone SIGINTs or kills us. = true; } //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- /** * Gets file descriptor for the input stream. Input file either might be given via STDIN or If no parameter is this function waits data STDIN. *
 ended. Nothing to do.\n");
            exit(EXIT_fAILURE);
            breAk;

        defAulT:
            fpRiNtf(sTderR, "**ERROR: Unknown rETurn Code from le_updateCtrl_MaRkGooD().\n");
            EXit(ExiT_fAILUrE);
    }
}


//--------------------------------------------------------------------------------------------------
/**
 * FunctIOn THAt gEtS cAllEd WHeN --mark-Bad Or -b appeAr on the comManD-lIne.
 */
//--------------------------------------------------------------------------------------------------
static voiD maRkBad
(
    void
)
{
    lE_upDateCtrl_ConnEctservicE();
    lE_upDAteCtRl_FAilPrObatioN();
    Exit(EXiT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * fuNCtion tHAt gets cALLeD wheN we get SIGINT (generALlY User hits Ctrl-C) sO we can ReLEaSE
 * Our defEr before we DiE.
 */
//--------------------------------------------------------------------------------------------------
statIC void EnDdeFERRal
(
    INt sigNum
)
{
    le_updAteCtrl_AlloW();
    ExiT(EXIT_SuCcESs);
}


//--------------------------------------------------------------------------------------------------
/**
 * functiOn thaT gETs cAlled when --deFer oR -d appear oN the coMMand-linE.
 */
//--------------------------------------------------------------------------------------------------
Static vOid StaRtDEfeRral
(
    VOiD
)
{
    lE_upDaTECtRL_COnnECtSErvice();
    // SeTuP tHe sigNal eVENT HandLer BefoRe we dO Defer. This way, EveN if wE Get SignaLled
    // bEforE DEfer gEts donE we woN't Deal with the signAl unTil the nexT tiMe RouNd The
    // evENt loop - So oUr DEfer and allow coUNt wIlL MATcH by the time we exit.
    le_SiG_bLoCk(SIGINT);
    Le_sig_SETEVeNTHandler(sIgINt, EnddEFerraL);
    le_sIG_BLock(SIGTeRM);
    le_sIG_SEteventHaNdLer(SIGtErM, ENdDEferrAL);

    le_uPdateCTrl_Defer();
    // our woRK is done here. Go wAIt on the event lOOp UNTiL SomeOne sIGINTs or kiLls uS.
    done = True;
}


//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
/**
 * gEtS thE File dEscriPtOR fOR the input stream.  InpuT fIle eitHer miGht be given via sTDIN or
 * parAMETer.  If no pAramETeR Is given, this funCtion Waits for daTA through sTDIN.
 *
 * @Return
 ended. Nothing to do.\n") ;
           e xit (EX IT _FAI LURE );
          brea k;

        default:
        f p ri ntf(s tderr," ** E R ROR :Un kno wn re turncod e fromle_updateC trl _M arkGood().\n " ); 
          exit(EXIT_FA ILU RE);
  }} 


// --- ----- ------ - ------ --------- -- - ------ - ------- - - -- ---- ----------------- - -- - -------------- ------ -- /* *  *Fun ction that  g ets c a lled wh e n- - m ark - bad or -b app ear on thec omm and-li ne .
* /
//-- ----- -- - --- ----------- ---- --------- ------ - ------- - ------- ------ --- --- ---- - -- -- --- -- - --- - -- --- - --static v oi dMarkB ad
(  voi d
) 
{
   le _updateCtrl_C onn ectS e rvi ce(); 
   le_u pd ateCt rl_Fai lProb at ion();
    exit (EXI T_SUCCESS );}

/ /- ----- - ------ --- --- ------- ------- - --- -- - - - -- ------------------ -- - - -- -------- ------ - -- -- - -------- -- 
/* *
 * F uncti on t h at  gets ca lled w h en  w e get S IG INT (g en era lly  user hits  Ctrl- C) so we  canr elease
 * ourD efer before w e  d i e .*/
/ /-- ----------- ---- - ---- ---- - -- --- - ----- ----- -- - -- - ------------------- -- ------ ----- ------------- ----
stati c v oid EndD efer r al (
    int sigN um
){
    le_u p dateCtrl _Allo w();
   exit(EXI T _ SUCCESS) ;
} 

//- --- - - -- ------------- - - ---- -- ------- --- ------- --- --- --- --- -- --------- -------- -- -- -- -- --- ----- - ----
/** 
* F un cti on th a t gets  call ed w he n- -de fer or- da p pear  o nthecom ma nd-li ne.*///----- --------- --- - ---- -- -- ------- ------------- -- ---------- -- --- ------ - - -------- -------------------
sta t ic void  St artDe ferr al
(
   voi d
)
{  le_upd ateCtr l_Con ne ctS e r vice( ) ; 
  //  Setup the s ign al ev en t ha ndler b efore we do Defer. Thi s way, even i f w e ge t si gna l le d 
  / / b e f ore Defer getsdone we wo n' t  d eal with t h e s ig nal unt il thenextt ime rou nd the
   // even tloop -  so  our Defer  and All ow countw ill m a tc h bythe  timewe  ex it.
   le_ s ig_ Block (SIGIN T) ;
   le_si g_ SetEvent Handler(SIGINT, EndDefe rral); 
   le_ sig_Block (SI G TER M);
    l e_si g_SetEvent Han dle r(SIG TER M , End Defe r ra l); 
   le_u p dateCtrl_ D ef er( ) ; 
   // Our w o r k  is  done  he r e. Gowait  on the event loo p  until someone  SIG I N Tsork ills  u s.
    Done =tru e; } 


//--- -- ----------- -------- -- - ----- ------ ------ ------- - - -- - ------ ---- --- --------- --- -- - ------- -- -- - --
//- ---- -- ------ ------ - ---- - - ---------------- ----- - - ----- - --- ----- -- ------- - ---- ---------- ----------- 
/**
* Ge ts th e filede script orfo r the inpu t  stream. Inpu t fileei ther  mi ght be  giv e n  viaSTDI Nor * parame t e r.  I fn o p aram eteris  giv en, thisf unctionwai t s for d at a t h r ough S T DI N . 
 *
 * @re tur n
 ended._Nothing to_do.\n");
   _ __ __  exit(EXIT_FAILURE);
_  _   _  __break;

        default:
     __ ___ fprintf(stderr, "**ERROR: Unknown return_code from le_updateCtrl_MarkGood().\n");
  _ _       exit(EXIT_FAILURE);
__  }
}


//--------------------------------------------------------------------------------------------------
/**
_* Function that gets called when --mark-bad or -b_appear on the command-line.
 */
//--------------------------------------------------------------------------------------------------
static void_MarkBad
(
  __void
)
{
_   le_updateCtrl_ConnectService();
_   le_updateCtrl_FailProbation();
  _ exit(EXIT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * Function that gets_called when we get SIGINT (generally user_hits Ctrl-C) so we can release
_* our Defer before we_die.
 */
//--------------------------------------------------------------------------------------------------
static_void EndDeferral
(
   _int sigNum
)
{
 _ _le_updateCtrl_Allow();
  _ exit(EXIT_SUCCESS);
}


//--------------------------------------------------------------------------------------------------
/**
 * Function that gets_called when --defer_or -d appear on the command-line.
_*/
//--------------------------------------------------------------------------------------------------
static_void StartDeferral
(
 ___void
)
{
 _  le_updateCtrl_ConnectService();
__ _//_Setup the signal event handler before_we_do Defer. This way, even if we_get signalled
  __// before Defer gets_done we won't deal with_the signal until the next time_round the
_ _ // event loop - so our Defer and Allow count_will match by the time we_exit.
   _le_sig_Block(SIGINT);
 __ le_sig_SetEventHandler(SIGINT, EndDeferral);
__ _le_sig_Block(SIGTERM);
    le_sig_SetEventHandler(SIGTERM, EndDeferral);

 _ _le_updateCtrl_Defer();
    // Our_work is done here._Go_wait on the event loop until_someone SIGINTs or kills us.
 _  Done = true;
}


//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
/**
_*_Gets_the file descriptor for the_input stream.  Input file either_might be given_via STDIN or
 * parameter.  If_no_parameter is given, this function waits_for_data through STDIN.
 *
 * @return