Misspelled

Issue #499 closed
SzV created an issue

Changed dependant -> dependent in all files. I hope you are happy about it.

diff --git a/CHANGES b/CHANGES
index 946bdce..3dd55fb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -490,7 +490,7 @@ stop/restart.

 Fixed: Issue #226: Monit hung during ping test.

-Fixed: Issue #248: Don't cascade start action to dependant services if only parent start was
+Fixed: Issue #248: Don't cascade start action to dependent services if only parent start was
 requested.

 Fixed: Issue #249: Implement hard dependency between services. If the service depends on
diff --git a/src/control.c b/src/control.c
index 9846bfd..86a583f 100644
--- a/src/control.c
+++ b/src/control.c
@@ -224,8 +224,8 @@ static boolean_t _doStart(Service_T s) {
         ASSERT(s);
         boolean_t rv = true;
         StringBuffer_T sb = StringBuffer_create(64);
-        for (Dependant_T d = s->dependantlist; d; d = d->next ) {
-                Service_T parent = Util_getService(d->dependant);
+        for (Dependent_T d = s->dependentlist; d; d = d->next ) {
+                Service_T parent = Util_getService(d->dependent);
                 ASSERT(parent);
                 if (parent->monitor != Monitor_Yes || parent->error) {
                         if (_doStart(parent)) {
@@ -353,8 +353,8 @@ static boolean_t _doRestart(Service_T s) {
  */
 static void _doMonitor(Service_T s) {
         ASSERT(s);
-        for (Dependant_T d = s->dependantlist; d; d = d->next ) {
-                Service_T parent = Util_getService(d->dependant);
+        for (Dependent_T d = s->dependentlist; d; d = d->next ) {
+                Service_T parent = Util_getService(d->dependent);
                 ASSERT(parent);
                 _doMonitor(parent);
         }
@@ -375,7 +375,7 @@ static void _doUnmonitor(Service_T s) {
 /*
  * This is an in-fix recursive function for control of services that depend on s
  * @param s A Service_T object
- * @param action An action for the dependant services
+ * @param action An action for the dependent services
  * @param unmonitor Disable service monitoring: used for stop action only to differentiate hard/soft stop - see _doStop()
  * @return true if all depending services were started/stopped otherwise false
  */
@@ -383,8 +383,8 @@ static boolean_t _doDepend(Service_T s, Action_Type action, boolean_t unmonitor)
         ASSERT(s);
         boolean_t rv = true;
         for (Service_T child = servicelist; child; child = child->next) {
-                for (Dependant_T d = child->dependantlist; d; d = d->next) {
-                        if (IS(d->dependant, s->name)) {
+                for (Dependent_T d = child->dependentlist; d; d = d->next) {
+                        if (IS(d->dependent, s->name)) {
                                 child->doaction = Action_Ignored;
                                 if (action == Action_Start) {
                                         // (re)start children only if it's monitoring is enabled (we keep monitoring flag during restart, allowing to restore original pre-restart configuration)
diff --git a/src/gc.c b/src/gc.c
index 7b41d49..a3c53d2 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -54,7 +54,7 @@ static void _gcptl(Timestamp_T *);
 static void _gcparl(ActionRate_T *);
 static void _gc_action(Action_T *);
 static void _gc_eventaction(EventAction_T *);
-static void _gcpdl(Dependant_T *);
+static void _gcpdl(Dependent_T *);
 static void _gcso(Size_T *);
 static void _gclinkstatus(LinkStatus_T *);
 static void _gclinkspeed(LinkSpeed_T *);
@@ -244,8 +244,8 @@ static void _gc_service(Service_T *s) {
                 _gcfsflag(&(*s)->fsflaglist);
         if ((*s)->nonexistlist)
                 _gcnonexist(&(*s)->nonexistlist);
-        if ((*s)->dependantlist)
-                _gcpdl(&(*s)->dependantlist);
+        if ((*s)->dependentlist)
+                _gcpdl(&(*s)->dependentlist);
         if ((*s)->start)
                 gccmd(&(*s)->start);
         if ((*s)->stop)
@@ -589,11 +589,11 @@ static void _gcnonexist(Nonexist_T *s) {
 }


-static void _gcpdl(Dependant_T *d) {
+static void _gcpdl(Dependent_T *d) {
         ASSERT(d);
         if ((*d)->next)
                 _gcpdl(&(*d)->next);
-        FREE((*d)->dependant);
+        FREE((*d)->dependent);
         FREE(*d);
 }

diff --git a/src/http/cervlet.c b/src/http/cervlet.c
index 3677a5d..867bf69 100644
--- a/src/http/cervlet.c
+++ b/src/http/cervlet.c
@@ -1037,11 +1037,11 @@ static void do_service(HttpRequest req, HttpResponse res, Service_T s) {
                             "<tr><td>Monitoring mode</td><td>%s</td></tr>", modenames[s->mode]);
         StringBuffer_append(res->outputbuffer,
                             "<tr><td>On reboot</td><td>%s</td></tr>", onrebootnames[s->onreboot]);
-        for (Dependant_T d = s->dependantlist; d; d = d->next) {
-                if (d->dependant != NULL) {
+        for (Dependent_T d = s->dependentlist; d; d = d->next) {
+                if (d->dependent != NULL) {
                         StringBuffer_append(res->outputbuffer,
                                             "<tr><td>Depends on service </td><td> <a href=%s> %s </a></td></tr>",
-                                            d->dependant, d->dependant);
+                                            d->dependent, d->dependent);
                 }
         }
         if (s->start) {
diff --git a/src/monit.h b/src/monit.h
index 0c6c08a..a91f839 100644
--- a/src/monit.h
+++ b/src/monit.h
@@ -697,12 +697,12 @@ typedef struct myicmp {
 } *Icmp_T;


-typedef struct mydependant {
-        char *dependant;                            /**< name of dependant service */
+typedef struct mydependent {
+        char *dependent;                            /**< name of dependent service */

         /** For internal use */
-        struct mydependant *next;             /**< next dependant service in chain */
-} *Dependant_T;
+        struct mydependent *next;             /**< next dependent service in chain */
+} *Dependent_T;


 /** Defines resource data */
@@ -1024,7 +1024,7 @@ typedef struct myservice {
         command_t restart;                /**< The restart command for the service */
         Program_T program;                            /**< Program execution check */

-        Dependant_T dependantlist;                     /**< Dependant service list */
+        Dependent_T dependentlist;                     /**< Dependent service list */
         Mail_T maillist;                       /**< Alert notification mailinglist */

         /** Test rules and event handlers */
diff --git a/src/p.y b/src/p.y
index a57807d..d553e06 100644
--- a/src/p.y
+++ b/src/p.y
@@ -221,7 +221,7 @@ static boolean_t _parseOutgoingAddress(const char *ip, Outgoing_T *outgoing);
 static void  addmail(char *, Mail_T, Mail_T *);
 static Service_T createservice(Service_Type, char *, char *, State_Type (*)(Service_T));
 static void  addservice(Service_T);
-static void  adddependant(char *);
+static void  adddependent(char *);
 static void  addservicegroup(char *);
 static void  addport(Port_T *, Port_T);
 static void  addhttpheader(Port_T, const char *);
@@ -2053,11 +2053,11 @@ group           : GROUP STRINGNAME {
 depend          : DEPENDS dependlist
                 ;

-dependlist      : dependant
-                | dependlist dependant
+dependlist      : dependent
+                | dependlist dependent
                 ;

-dependant       : SERVICENAME { adddependant($<string>1); }
+dependent       : SERVICENAME { adddependent($<string>1); }
                 ;

 statusvalue     : IF STATUS operator NUMBER rate1 THEN action1 recovery {
@@ -3158,21 +3158,21 @@ static void addservicegroup(char *name) {


 /*
- * Add a dependant entry to the current service dependant list
+ * Add a dependent entry to the current service dependent list
  *
  */
-static void adddependant(char *dependant) {
-        Dependant_T d;
+static void adddependent(char *dependent) {
+        Dependent_T d;

-        ASSERT(dependant);
+        ASSERT(dependent);

         NEW(d);

-        if (current->dependantlist)
-                d->next = current->dependantlist;
+        if (current->dependentlist)
+                d->next = current->dependentlist;

-        d->dependant = dependant;
-        current->dependantlist = d;
+        d->dependent = dependent;
+        current->dependentlist = d;

 }

@@ -4670,15 +4670,15 @@ static void check_depend() {
                 done = true;
                 found_some = false;
                 for (s = servicelist; s; s = s->next) {
-                        Dependant_T d;
+                        Dependent_T d;
                         if (s->visited)
                                 continue;
                         done = false; // still unvisited nodes
                         depends_on = NULL;
-                        for (d = s->dependantlist; d; d = d->next) {
-                                Service_T dp = Util_getService(d->dependant);
+                        for (d = s->dependentlist; d; d = d->next) {
+                                Service_T dp = Util_getService(d->dependent);
                                 if (! dp) {
-                                        LogError("Depend service '%s' is not defined in the control file\n", d->dependant);
+                                        LogError("Depend service '%s' is not defined in the control file\n", d->dependent);
                                         exit(1);
                                 }
                                 if (! dp->visited) {
diff --git a/src/util.c b/src/util.c
index b5d6cc5..f3c756c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1012,9 +1012,9 @@ void Util_printService(Service_T s) {
                 printf(" %-20s = %s\n", "Existence", StringBuffer_toString(Util_printRule(buf, o->action, "if does not exist")));
         }

-        for (Dependant_T o = s->dependantlist; o; o = o->next)
-                if (o->dependant != NULL)
-                        printf(" %-20s = %s\n", "Depends on Service", o->dependant);
+        for (Dependent_T o = s->dependentlist; o; o = o->next)
+                if (o->dependent != NULL)
+                        printf(" %-20s = %s\n", "Depends on Service", o->dependent);

         for (Pid_T o = s->pidlist; o; o = o->next) {
                 StringBuffer_clear(buf);
diff --git a/src/validate.c b/src/validate.c
index 87e971b..ff030f1 100644
--- a/src/validate.c
+++ b/src/validate.c
@@ -1013,8 +1013,8 @@ static boolean_t _checkSkip(Service_T s) {
         }
         s->monitor &= ~Monitor_Waiting;
         // Skip if parent is not initialized
-        for (Dependant_T d = s->dependantlist; d; d = d->next ) {
-                Service_T parent = Util_getService(d->dependant);
+        for (Dependent_T d = s->dependentlist; d; d = d->next ) {
+                Service_T parent = Util_getService(d->dependent);
                 if (parent->monitor != Monitor_Yes) {
                         DEBUG("'%s' test skipped as required service '%s' is %s\n", s->name, parent->name, parent->monitor == Monitor_Init ? "initializing" : "not monitored");
                         return true;

Comments (1)

  1. Tildeslash repo owner

    According to the Oxford English Dictionary, dependant is interchangeable with dependent, though the latter is more standard in US English. I don't think this is important in the source code, but might be so in documentation where I believe we already use dependent. We'll accept a PR if you care to create one.

  2. Log in to comment