Module Name: src
Committed By: joerg
Date: Thu Mar 1 22:31:48 UTC 2012
Modified Files:
src/usr.sbin/isdn/isdnd: isdnd.h rates.c rc_config.c support.c timer.c
Log Message:
Fix format strings to deal with 64bit time_t.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/isdn/isdnd/isdnd.h
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/isdn/isdnd/rates.c
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/isdn/isdnd/rc_config.c
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/isdn/isdnd/support.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/isdn/isdnd/timer.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/isdn/isdnd/isdnd.h
diff -u src/usr.sbin/isdn/isdnd/isdnd.h:1.17 src/usr.sbin/isdn/isdnd/isdnd.h:1.18
--- src/usr.sbin/isdn/isdnd/isdnd.h:1.17 Wed Aug 31 13:32:37 2011
+++ src/usr.sbin/isdn/isdnd/isdnd.h Thu Mar 1 22:31:48 2012
@@ -27,7 +27,7 @@
* i4b daemon - main header file
* -----------------------------
*
- * $Id: isdnd.h,v 1.17 2011/08/31 13:32:37 joerg Exp $
+ * $Id: isdnd.h,v 1.18 2012/03/01 22:31:48 joerg Exp $
*
* $FreeBSD$
*
@@ -791,7 +791,7 @@ void init_controller_protocol ( void );
void init_single_controller_protocol ( struct isdn_ctrl_state *ctrl );
void init_log ( void );
void init_screen ( void );
-void logit ( int what, const char *fmt, ... );
+void logit ( int what, const char *fmt, ... ) __printflike(2, 3);
int main ( int argc, char **argv );
void msg_accounting ( msg_accounting_ind_t *mp );
void msg_alert_ind ( msg_alert_ind_t *mp );
Index: src/usr.sbin/isdn/isdnd/rates.c
diff -u src/usr.sbin/isdn/isdnd/rates.c:1.6 src/usr.sbin/isdn/isdnd/rates.c:1.7
--- src/usr.sbin/isdn/isdnd/rates.c:1.6 Sat Oct 30 08:19:30 2004
+++ src/usr.sbin/isdn/isdnd/rates.c Thu Mar 1 22:31:48 2012
@@ -35,7 +35,7 @@
* i4b daemon - charging rates description file handling
* -----------------------------------------------------
*
- * $Id: rates.c,v 1.6 2004/10/30 08:19:30 dsl Exp $
+ * $Id: rates.c,v 1.7 2012/03/01 22:31:48 joerg Exp $
*
* $FreeBSD$
*
@@ -391,8 +391,8 @@ get_current_rate(struct cfg_entry *cep,
{
case ULSRC_CMDL: /* specified on commandline */
if (dolog)
- logit(LL_CHD, "%05d %s rate %d sec/unit (cmdl)",
- cep->cdid, cep->name, unit_length);
+ logit(LL_CHD, "%05d %s rate %jd sec/unit (cmdl)",
+ cep->cdid, cep->name, (intmax_t)unit_length);
return(unit_length);
break;
@@ -493,7 +493,7 @@ getrate(int rate_type )
if ((time_now >= hd->start_time ) &&
(time_now < hd->end_time ))
{
- DBGL(DL_RATES, (logit(LL_DBG, "rate=%d sec/unit (day=%d, beg=%d:%2.2d, end=%d:2.2d, current=%d:%2.2d)",
+ DBGL(DL_RATES, (logit(LL_DBG, "rate=%d sec/unit (day=%d, beg=%d:%2.2d, end=%d:%2.2d, current=%d:%2.2d)",
hd->rate,
ptr->tm_wday,
hd->start_time/60, hd->start_time%60,
Index: src/usr.sbin/isdn/isdnd/rc_config.c
diff -u src/usr.sbin/isdn/isdnd/rc_config.c:1.25 src/usr.sbin/isdn/isdnd/rc_config.c:1.26
--- src/usr.sbin/isdn/isdnd/rc_config.c:1.25 Thu Apr 16 05:56:32 2009
+++ src/usr.sbin/isdn/isdnd/rc_config.c Thu Mar 1 22:31:48 2012
@@ -27,7 +27,7 @@
* i4b daemon - config file processing
* -----------------------------------
*
- * $Id: rc_config.c,v 1.25 2009/04/16 05:56:32 lukem Exp $
+ * $Id: rc_config.c,v 1.26 2012/03/01 22:31:48 joerg Exp $
*
* $FreeBSD$
*
@@ -454,13 +454,13 @@ cfg_setval(int keyword)
FILE *fp;
int s, l;
int n;
- DBGL(DL_RCCF, (logit(LL_DBG, "entry %s: budget-callbacksfile = %s", yylval.str)));
+ DBGL(DL_RCCF, (logit(LL_DBG, "entry %s: budget-callbacksfile = %s", current_cfe->name, yylval.str)));
fp = fopen(yylval.str, "r");
if (fp != NULL)
{
if ((fscanf(fp, "%d %d %d", (int *)&s, (int *)&l, &n)) != 3)
{
- DBGL(DL_RCCF, (logit(LL_DBG, "entry %d: initializing budget-callbacksfile %s", current_cfe->name, yylval.str)));
+ DBGL(DL_RCCF, (logit(LL_DBG, "entry %s: initializing budget-callbacksfile %s", current_cfe->name, yylval.str)));
fclose(fp);
fp = fopen(yylval.str, "w");
if (fp != NULL) {
@@ -1134,7 +1134,7 @@ parse_valid(char *dt)
ret = sscanf(dt, "%d:%d-%d:%d", &fromhr, &frommin, &tohr, &tomin);
if (ret !=4)
{
- logit(LL_ERR, "ERROR parsing config file: timespec [%s] error at line %d!", *dt, lineno);
+ logit(LL_ERR, "ERROR parsing config file: timespec [%s] error at line %d!", dt, lineno);
config_error_flag++;
return;
}
@@ -1142,7 +1142,7 @@ parse_valid(char *dt)
if (fromhr < 0 || fromhr > 24 || tohr < 0 || tohr > 24 ||
frommin < 0 || frommin > 59 || tomin < 0 || tomin > 59)
{
- logit(LL_ERR, "ERROR parsing config file: invalid time [%s] at line %d!", *dt, lineno);
+ logit(LL_ERR, "ERROR parsing config file: invalid time [%s] at line %d!", dt, lineno);
config_error_flag++;
return;
}
Index: src/usr.sbin/isdn/isdnd/support.c
diff -u src/usr.sbin/isdn/isdnd/support.c:1.15 src/usr.sbin/isdn/isdnd/support.c:1.16
--- src/usr.sbin/isdn/isdnd/support.c:1.15 Thu Apr 16 05:56:32 2009
+++ src/usr.sbin/isdn/isdnd/support.c Thu Mar 1 22:31:48 2012
@@ -27,7 +27,7 @@
* i4b daemon - misc support routines
* ----------------------------------
*
- * $Id: support.c,v 1.15 2009/04/16 05:56:32 lukem Exp $
+ * $Id: support.c,v 1.16 2012/03/01 22:31:48 joerg Exp $
*
* $FreeBSD$
*
@@ -679,7 +679,7 @@ handle_charge(struct cfg_entry *cep)
{
if (cep->aoc_diff != cep->unitlength)
{
- DBGL(DL_MSG, (logit(LL_DBG, "handle_charge: AOCD unit length updated %d -> %d secs", cep->unitlength, cep->aoc_diff)));
+ DBGL(DL_MSG, (logit(LL_DBG, "handle_charge: AOCD unit length updated %d -> %jd secs", cep->unitlength, (intmax_t)cep->aoc_diff)));
cep->unitlength = cep->aoc_diff;
Index: src/usr.sbin/isdn/isdnd/timer.c
diff -u src/usr.sbin/isdn/isdnd/timer.c:1.4 src/usr.sbin/isdn/isdnd/timer.c:1.5
--- src/usr.sbin/isdn/isdnd/timer.c:1.4 Mon Oct 6 09:43:27 2003
+++ src/usr.sbin/isdn/isdnd/timer.c Thu Mar 1 22:31:48 2012
@@ -27,7 +27,7 @@
* i4b daemon - timer/timing support routines
* ------------------------------------------
*
- * $Id: timer.c,v 1.4 2003/10/06 09:43:27 itojun Exp $
+ * $Id: timer.c,v 1.5 2012/03/01 22:31:48 joerg Exp $
*
* $FreeBSD$
*
@@ -96,25 +96,25 @@ hr_callgate(void)
if ((tv_now.tv_sec - tv_last.tv_sec) < 1)
{
- DBGL(DL_TIME, (logit(LL_DBG, "time < 1 - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
+ DBGL(DL_TIME, (logit(LL_DBG, "time < 1 - last %jd:%ld now %jd:%ld",
+ (intmax_t)tv_last.tv_sec, (long)tv_last.tv_usec,
+ (intmax_t)tv_now.tv_sec, (long)tv_now.tv_usec)));
return(1);
}
else if ((tv_now.tv_sec - tv_last.tv_sec) == 1)
{
if (((1000000 - tv_last.tv_usec) + tv_now.tv_usec) < 900000)
{
- DBGL(DL_TIME, (logit(LL_DBG, "time < 900000us - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
+ DBGL(DL_TIME, (logit(LL_DBG, "time < 900000us - last %jd:%ld now %jd:%ld",
+ (intmax_t)tv_last.tv_sec, (long)tv_last.tv_usec,
+ (intmax_t)tv_now.tv_sec, (long)tv_now.tv_usec)));
return(1);
}
}
- DBGL(DL_TIME, (logit(LL_DBG, "time OK! - last %ld:%ld now %ld:%ld",
- tv_last.tv_sec, tv_last.tv_usec,
- tv_now.tv_sec, tv_now.tv_usec)));
+ DBGL(DL_TIME, (logit(LL_DBG, "time OK! - last %jd:%ld now %jd:%ld",
+ (intmax_t)tv_last.tv_sec, (long)tv_last.tv_usec,
+ (intmax_t)tv_now.tv_sec, (long)tv_now.tv_usec)));
gettimeofday(&tv_last, NULL);