monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[monit-dev] [monit] r318 committed - [No log message]


From: monit
Subject: [monit-dev] [monit] r318 committed - [No log message]
Date: Tue, 28 Dec 2010 23:09:36 +0000

Revision: 318
Author: address@hidden
Date: Tue Dec 28 15:09:18 2010
Log: [No log message]
http://code.google.com/p/monit/source/detail?r=318

Modified:
 /trunk/device/device_common.c
 /trunk/device/sysdep_AIX.c
 /trunk/device/sysdep_DARWIN.c
 /trunk/device/sysdep_FREEBSD.c
 /trunk/device/sysdep_HPUX.c
 /trunk/device/sysdep_LINUX.c
 /trunk/device/sysdep_NETBSD.c
 /trunk/device/sysdep_OPENBSD.c
 /trunk/device/sysdep_SOLARIS.c
 /trunk/gc.c
 /trunk/p.y
 /trunk/validate.c

=======================================
--- /trunk/device/device_common.c       Tue Dec 28 13:00:51 2010
+++ /trunk/device/device_common.c       Tue Dec 28 15:09:18 2010
@@ -99,7 +99,6 @@
   }

   if(S_ISREG(buf.st_mode) || S_ISDIR(buf.st_mode)) {
-    FREE(inf->priv.filesystem.mntpath);
     inf->priv.filesystem.mntpath = xstrdup(object);
     return inf->priv.filesystem.mntpath;
   } else if(S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode)) {
@@ -122,15 +121,16 @@
* @return TRUE if informations were succesfully read otherwise FALSE
  */
 int filesystem_usage(Info_T inf, char *object) {
+  int rv;
+
   ASSERT(inf);
   ASSERT(object);

   if(!device_path(inf, object))
     return FALSE;
-
-  /* save the previous filesystem flags */
-  inf->priv.filesystem._flags= inf->priv.filesystem.flags;
-
-  return filesystem_usage_sysdep(inf);
+  inf->priv.filesystem._flags = inf->priv.filesystem.flags;
+  rv = filesystem_usage_sysdep(inf);
+  FREE(inf->priv.filesystem.mntpath);
+  return rv;
 }

=======================================
--- /trunk/device/sysdep_AIX.c  Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_AIX.c  Tue Dec 28 15:09:18 2010
@@ -88,7 +88,6 @@
   while ((mnt = getmntent(mntfd)) != NULL) {
     if (IS(blockdev, mnt->mnt_fsname)) {
       endmntent(mntfd);
-      FREE(inf->priv.filesystem.mntpath);
       inf->priv.filesystem.mntpath = xstrdup(mnt->mnt_dir);
       return inf->priv.filesystem.mntpath;
     }
=======================================
--- /trunk/device/sysdep_DARWIN.c       Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_DARWIN.c       Tue Dec 28 15:09:18 2010
@@ -87,7 +87,6 @@
       for (i = 0; i < countfs; i++) {
         struct statfs *sfs = statfs + i;
         if (IS(sfs->f_mntfromname, blockdev)) {
-          FREE(inf->priv.filesystem.mntpath);
           inf->priv.filesystem.mntpath = xstrdup(sfs->f_mntonname);
           FREE(statfs);
           return inf->priv.filesystem.mntpath;
=======================================
--- /trunk/device/sysdep_FREEBSD.c      Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_FREEBSD.c      Tue Dec 28 15:09:18 2010
@@ -87,7 +87,6 @@
       for (i = 0; i < countfs; i++) {
         struct statfs *sfs = statfs + i;
         if (IS(sfs->f_mntfromname, blockdev)) {
-          FREE(inf->priv.filesystem.mntpath);
           inf->priv.filesystem.mntpath = xstrdup(sfs->f_mntonname);
           FREE(statfs);
           return inf->priv.filesystem.mntpath;
=======================================
--- /trunk/device/sysdep_HPUX.c Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_HPUX.c Tue Dec 28 15:09:18 2010
@@ -89,7 +89,6 @@
   while ((mnt = getmntent(mntfd)) != NULL) {
     if (IS(blockdev, mnt->mnt_fsname)) {
       endmntent(mntfd);
-      FREE(inf->priv.filesystem.mntpath);
       inf->priv.filesystem.mntpath = xstrdup(mnt->mnt_dir);
       return inf->priv.filesystem.mntpath;
     }
=======================================
--- /trunk/device/sysdep_LINUX.c        Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_LINUX.c        Tue Dec 28 15:09:18 2010
@@ -89,7 +89,6 @@
   while ((mnt = getmntent(mntfd)) != NULL) {
     if (IS(blockdev, mnt->mnt_fsname)) {
       endmntent(mntfd);
-      FREE(inf->priv.filesystem.mntpath);
       inf->priv.filesystem.mntpath = xstrdup(mnt->mnt_dir);
       return inf->priv.filesystem.mntpath;
     }
=======================================
--- /trunk/device/sysdep_NETBSD.c       Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_NETBSD.c       Tue Dec 28 15:09:18 2010
@@ -90,7 +90,6 @@
       for (i = 0; i < countfs; i++) {
         struct statvfs *sfs = statvfs + i;
         if (IS(sfs->f_mntfromname, blockdev)) {
-          FREE(inf->priv.filesystem.mntpath);
           inf->priv.filesystem.mntpath = xstrdup(sfs->f_mntonname);
           FREE(statvfs);
           return inf->priv.filesystem.mntpath;
=======================================
--- /trunk/device/sysdep_OPENBSD.c      Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_OPENBSD.c      Tue Dec 28 15:09:18 2010
@@ -83,7 +83,6 @@
       for (i = 0; i < countfs; i++) {
         struct statfs *sfs = statfs + i;
         if (IS(sfs->f_mntfromname, blockdev)) {
-          FREE(inf->priv.filesystem.mntpath);
           inf->priv.filesystem.mntpath = xstrdup(sfs->f_mntonname);
           FREE(statfs);
           return inf->priv.filesystem.mntpath;
=======================================
--- /trunk/device/sysdep_SOLARIS.c      Tue Dec 28 13:00:51 2010
+++ /trunk/device/sysdep_SOLARIS.c      Tue Dec 28 15:09:18 2010
@@ -90,7 +90,6 @@
     char real_mnt_special[PATH_MAX+1];
if (realpath(mnt.mnt_special, real_mnt_special) && IS(real_mnt_special, blockdev)) {
         fclose(mntfd);
-        FREE(inf->priv.filesystem.mntpath);
         inf->priv.filesystem.mntpath = xstrdup(mnt.mnt_mountp);
         return inf->priv.filesystem.mntpath;
     }
=======================================
--- /trunk/gc.c Tue Dec 28 13:00:51 2010
+++ /trunk/gc.c Tue Dec 28 15:09:18 2010
@@ -460,7 +460,6 @@

 static void _gc_inf(Info_T *i) {
   ASSERT(i);
-  FREE((*i)->priv.filesystem.mntpath);
   FREE(*i);
 }

=======================================
--- /trunk/p.y  Tue Dec 28 13:00:51 2010
+++ /trunk/p.y  Tue Dec 28 15:09:18 2010
@@ -2002,8 +2002,7 @@
   else
     NEW(current);

-  /* Reset the current object */
-  memset(current, 0, sizeof(*current));
+  current->type = type;

   NEW(current->inf);
   Util_resetInfo(current);
@@ -2012,7 +2011,6 @@
   current->monitor = MONITOR_INIT;
   current->mode    = MODE_ACTIVE;
   current->name    = name;
-  current->type    = type;
   current->check   = check;
   current->path    = value;

@@ -2032,7 +2030,6 @@
addeventaction(&(current)->action_ACTION, ACTION_ALERT, ACTION_IGNORE);

   gettimeofday(&current->collected, NULL);
-
 }


=======================================
--- /trunk/validate.c   Tue Dec 28 13:00:51 2010
+++ /trunk/validate.c   Tue Dec 28 15:09:18 2010
@@ -641,7 +641,7 @@
     return;

   if (s->inf->priv.process._pid != s->inf->priv.process.pid)
- Event_post(s, Event_Pid, STATE_CHANGED, s->action_PID, "process PID changed to %d", s->inf->priv.process.pid); + Event_post(s, Event_Pid, STATE_CHANGED, s->action_PID, "process PID changed from %d to %d", s->inf->priv.process._pid, s->inf->priv.process.pid);
   else
Event_post(s, Event_Pid, STATE_CHANGEDNOT, s->action_PID, "process PID has not changed since last cycle");
 }
@@ -659,7 +659,7 @@
     return;

   if (s->inf->priv.process._ppid != s->inf->priv.process.ppid)
- Event_post(s, Event_PPid, STATE_CHANGED, s->action_PPID, "process PPID changed to %d", s->inf->priv.process.ppid); + Event_post(s, Event_PPid, STATE_CHANGED, s->action_PPID, "process PPID changed from %d to %d", s->inf->priv.process._ppid, s->inf->priv.process.ppid);
   else
Event_post(s, Event_PPid, STATE_CHANGEDNOT, s->action_PPID, "process PPID has not changed since last cycle");
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]