Tags: patch Patches are available via monit cvs. Log message: Added large file support patch by Will Bryant URL: http://www.mail-archive.com/[email protected]/msg00457.html Discussion: http://www.mail-archive.com/[email protected]/msg00428.html
attached is an edited version of the patches made in cvs. -- Kind Regards, Michael Mende
===================================================================
RCS file: /sources/monit/monit/http/cervlet.c,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -r1.205 -r1.206
--- monit/http/cervlet.c 2006/07/04 10:40:17 1.205
+++ monit/http/cervlet.c 2006/07/05 12:47:49 1.206
#@@ -146,7 +146,7 @@
# * @author Martin Pala <[EMAIL PROTECTED]>
# * @author Christian Hopp <[EMAIL PROTECTED]>
# *
#- * @version \$Id: cervlet.c,v 1.205 2006/07/04 10:40:17 martinp Exp $
#+ * @version \$Id: cervlet.c,v 1.206 2006/07/05 12:47:49 hauk Exp $
# *
# * @file
# */
@@ -1060,11 +1060,11 @@
} else {
out_print(res,
- "<td align=\"right\">%lu B</td>"
+ "<td align=\"right\">%llu B</td>"
"<td align=\"right\">%o</td>"
"<td align=\"right\">%d</td>"
"<td align=\"right\">%d</td>",
- (unsigned long)s->inf->st_size,
+ (unsigned long long)s->inf->st_size,
s->inf->st_mode & 07777,
s->inf->st_uid,
s->inf->st_gid);
@@ -1675,7 +1675,7 @@
out_print(res,
"<tr><td>Associated size</td>"
- "<td>If %s %lu byte(s) %s then %s else if passed %s then
%s</td></tr>",
+ "<td>If %s %llu byte(s) %s then %s else if passed %s then
%s</td></tr>",
operatornames[sl->operator], sl->size,
ratio1, actionnames[a->failed->id],
ratio2, actionnames[a->passed->id]);
@@ -2162,9 +2162,9 @@
} else {
out_print(res,
- "<tr><td>Size</td><td><font%s>%lu B</td></tr>",
+ "<tr><td>Size</td><td><font%s>%llu B</td></tr>",
(s->error & EVENT_SIZE)?" color='#ff0000'":"",
- (unsigned long) s->inf->st_size);
+ (unsigned long long) s->inf->st_size);
}
}
@@ -2419,8 +2419,8 @@
}
if(s->type == TYPE_FILE) {
out_print(res,
- " %-33s %lu B\n",
- "size", (unsigned long) s->inf->st_size);
+ " %-33s %llu B\n",
+ "size", (unsigned long long) s->inf->st_size);
if(s->checksum) {
out_print(res,
" %-33s %s(%s)\n",
===================================================================
RCS file: /sources/monit/monit/configure.ac,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -r1.142 -r1.143
--- monit/configure.ac 2006/07/03 15:38:59 1.142
+++ monit/configure.ac 2006/07/05 12:47:49 1.143
#@@ -1,7 +1,7 @@
# # Process this file with autoconf to produce a configure script.
# # Mark Ferlatte, <[EMAIL PROTECTED]>
# #
#-# $Id: configure.ac,v 1.142 2006/07/03 15:38:59 martinp Exp $
#+# $Id: configure.ac,v 1.143 2006/07/05 12:47:49 hauk Exp $
#
# # autoconf requirement
# AC_PREREQ([2.53])
#@@ -10,7 +10,7 @@
# AC_INIT([monit], [4.8.2-cvs], [EMAIL PROTECTED])
#
# # Package info
#-AC_REVISION([$Revision: 1.142 $])
#+AC_REVISION([$Revision: 1.143 $])
# AC_CONFIG_SRCDIR([monitor.c])
#
# # ------------------------------------------------------------------------
@@ -291,6 +291,9 @@
AC_CHECK_FUNCS(setlocale)
AC_CHECK_FUNCS(getaddrinfo)
+# Turn on large-file support, on those platforms that implement it
+AC_SYS_LARGEFILE
+
# Check if we do need external GNU replacements
AC_FUNC_GETLOADAVG
===================================================================
RCS file: /sources/monit/monit/monitor.h,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -r1.187 -r1.188
--- monit/monitor.h 2006/06/28 09:02:43 1.187
+++ monit/monitor.h 2006/07/05 12:47:49 1.188
@@ -493,7 +493,7 @@
/** Defines size object */
typedef struct mysize {
int operator; /**< Comparison operator */
- unsigned long size; /**< Size watermark */
+ unsigned long long size; /**< Size watermark */
int test_changes; /**< TRUE if we only should test for changes */
EventAction_T action; /**< Description of the action upon event occurence */
@@ -585,8 +585,8 @@
long space_total; /**< Used space total blocks */
/* File specific */
- size_t st_size; /**< Size */
- size_t readpos; /**< Position for regex matching */
+ off_t st_size; /**< Size */
+ off_t readpos; /**< Position for regex matching */
ino_t st_ino_prev; /**< Previous inode for regex matching */
char *cs_sum; /**< Checksum */
===================================================================
RCS file: /sources/monit/monit/p.y,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -r1.236 -r1.237
--- monit/p.y 2006/06/23 20:38:12 1.236
+++ monit/p.y 2006/07/05 12:47:49 1.237
#@@ -30,7 +30,7 @@
# * @author Martin Pala <[EMAIL PROTECTED]>
# * @author Christian Hopp <[EMAIL PROTECTED]>
# * @author Rory Toma <[EMAIL PROTECTED]>
#- * @version \$Id: p.y,v 1.236 2006/06/23 20:38:12 martinp Exp $
#+ * @version \$Id: p.y,v 1.237 2006/07/05 12:47:49 hauk Exp $
# */
#
# #include <config.h>
@@ -1448,7 +1448,7 @@
size : IF SIZE operator NUMBER unit rate1 THEN action1 recovery {
sizeset.operator= $<number>3;
- sizeset.size= ((unsigned long)$4 * $<number>5);
+ sizeset.size= ((unsigned long long)$4 * $<number>5);
addeventaction(&(sizeset).action, $<number>8, $<number>9);
addsize(&sizeset, FALSE);
}
@@ -2044,7 +2044,7 @@
s->action= ss->action;
s->test_changes= ss->test_changes;
if(ss->test_changes || nosize)
- s->size= (unsigned long)buf.st_size;
+ s->size= (unsigned long long)buf.st_size;
s->next= current->sizelist;
current->sizelist= s;
===================================================================
RCS file: /sources/monit/monit/util.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -r1.184 -r1.185
--- monit/util.c 2006/04/27 20:16:03 1.184
+++ monit/util.c 2006/07/05 12:47:49 1.185
#@@ -119,7 +119,7 @@
# * @author Christian Hopp <[EMAIL PROTECTED]>
# * @author Michael Amster, <[EMAIL PROTECTED]>
# *
#- * @version \$Id: util.c,v 1.184 2006/04/27 20:16:03 martinp Exp $
#+ * @version \$Id: util.c,v 1.185 2006/07/05 12:47:49 hauk Exp $
# * @file
# */
#
@@ -862,7 +862,7 @@
"Size",
ratio1, actionnames[a->failed->id]);
else
- printf(" %-20s = if %s %lu byte(s) %s then %s else if passed %s then
%s\n",
+ printf(" %-20s = if %s %llu byte(s) %s then %s else if passed %s then
%s\n",
"Size", operatornames[sl->operator], sl->size,
ratio1, actionnames[a->failed->id],
ratio2, actionnames[a->passed->id]);
@@ -1759,7 +1759,7 @@
* @param rightExpression rval
* Returns the boolean value of the expression
*/
-int Util_evalQExpression(int operator, int left, int right) {
+int Util_evalQExpression(int operator, long long left, long long right) {
switch(operator) {
case OPERATOR_GREATER:
===================================================================
RCS file: /sources/monit/monit/util.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- monit/util.h 2006/04/11 23:23:26 1.15
+++ monit/util.h 2006/07/05 12:47:49 1.16
#@@ -30,7 +30,7 @@
# * @author Christian Hopp <[EMAIL PROTECTED]>
# * @author Michael Amster, <[EMAIL PROTECTED]>
# *
#- * @version \$Id: util.h,v 1.15 2006/04/11 23:23:26 hauk Exp $
#+ * @version \$Id: util.h,v 1.16 2006/07/05 12:47:49 hauk Exp $
# * @file
# */
#
@@ -371,7 +371,7 @@
* @param rightExpression rval
* @return the boolean value of the expression
*/
-int Util_evalQExpression(int operator, int left, int right);
+int Util_evalQExpression(int operator, long long left, long long right);
/*
===================================================================
RCS file: /sources/monit/monit/validate.c,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -r1.154 -r1.155
--- monit/validate.c 2006/06/28 09:02:43 1.154
+++ monit/validate.c 2006/07/05 12:47:49 1.155
#@@ -90,7 +90,7 @@
# * @author Martin Pala <[EMAIL PROTECTED]>
# * @author Christian Hopp <[EMAIL PROTECTED]>
# *
#- * @version \$Id: validate.c,v 1.154 2006/06/28 09:02:43 martinp Exp $
#+ * @version \$Id: validate.c,v 1.155 2006/07/05 12:47:49 hauk Exp $
# * @file
# */
#
@@ -1094,7 +1094,7 @@
/* reset expected value for next cycle */
sl->size= s->inf->st_size;
} else {
- DEBUG("'%s' size has not changed [current size=%lu B]\n", s->name,
+ DEBUG("'%s' size has not changed [current size=%llu B]\n", s->name,
s->inf->st_size);
Event_post(s, EVENT_CHANGED, STATE_PASSED, sl->action,
"'%s' size was not changed", s->name, s->path);
@@ -1105,10 +1105,10 @@
/* we are testing constant value for failed or passed state */
if(Util_evalQExpression(sl->operator, s->inf->st_size, sl->size)) {
Event_post(s, EVENT_SIZE, STATE_FAILED, sl->action,
- "'%s' size test failed for %s -- current size is %lu B",
+ "'%s' size test failed for %s -- current size is %llu B",
s->name, s->path, s->inf->st_size);
} else {
- DEBUG("'%s' file size check passed [current size=%lu B]\n", s->name,
+ DEBUG("'%s' file size check passed [current size=%llu B]\n", s->name,
s->inf->st_size);
Event_post(s, EVENT_SIZE, STATE_PASSED, sl->action, "'%s' size passed",
s->name);
}
===================================================================
RCS file: /sources/monit/monit/xml.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- monit/xml.c 2006/07/04 10:40:17 1.25
+++ monit/xml.c 2006/07/05 12:47:49 1.26
#@@ -50,7 +50,7 @@
# *
# * @author Martin Pala, <[EMAIL PROTECTED]>
# *
#- * @version \$Id: xml.c,v 1.25 2006/07/04 10:40:17 martinp Exp $
#+ * @version \$Id: xml.c,v 1.26 2006/07/05 12:47:49 hauk Exp $
# *
# * @file
# */
@@ -214,8 +214,8 @@
}
if(S->type == TYPE_FILE) {
buf_print(B,
- "\t\t<size>%lu</size>\r\n",
- (unsigned long) S->inf->st_size);
+ "\t\t<size>%llu</size>\r\n",
+ (unsigned long long) S->inf->st_size);
if(S->checksum) {
buf_print(B,
"\t\t<checksum type=\"%s\">%s</checksum>\r\n",
signature.asc
Description: Digital signature

