Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/syslogd fix two bugs related to queues (Anthony Mal...
details: https://anonhg.NetBSD.org/src/rev/5143168cb933
branches: trunk
changeset: 791233:5143168cb933
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 09 18:58:22 2013 +0000
description:
fix two bugs related to queues (Anthony Mallet)
- the default values are in humanized number form so strtol does not work
- fix reversed size tests
diffstat:
usr.sbin/syslogd/syslogd.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (48 lines):
diff -r 04d9290799b2 -r 5143168cb933 usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c Sat Nov 09 18:31:53 2013 +0000
+++ b/usr.sbin/syslogd/syslogd.c Sat Nov 09 18:58:22 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syslogd.c,v 1.115 2013/05/27 23:15:51 christos Exp $ */
+/* $NetBSD: syslogd.c,v 1.116 2013/11/09 18:58:22 christos Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
-__RCSID("$NetBSD: syslogd.c,v 1.115 2013/05/27 23:15:51 christos Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.116 2013/11/09 18:58:22 christos Exp $");
#endif
#endif /* not lint */
@@ -3143,13 +3143,13 @@
if (!TypeInfo[i].queue_length_string
|| dehumanize_number(TypeInfo[i].queue_length_string,
&TypeInfo[i].queue_length) == -1)
- TypeInfo[i].queue_length = strtol(
- TypeInfo[i].default_length_string, NULL, 10);
+ dehumanize_number(TypeInfo[i].default_length_string,
+ &TypeInfo[i].queue_length);
if (!TypeInfo[i].queue_size_string
|| dehumanize_number(TypeInfo[i].queue_size_string,
&TypeInfo[i].queue_size) == -1)
- TypeInfo[i].queue_size = strtol(
- TypeInfo[i].default_size_string, NULL, 10);
+ dehumanize_number(TypeInfo[i].default_size_string,
+ &TypeInfo[i].queue_size);
}
#ifndef DISABLE_SIGN
@@ -4366,9 +4366,9 @@
while (removed < del_entries
|| (TypeInfo[f->f_type].queue_length != -1
- && (size_t)TypeInfo[f->f_type].queue_length > f->f_qelements)
+ && (size_t)TypeInfo[f->f_type].queue_length <= f->f_qelements)
|| (TypeInfo[f->f_type].queue_size != -1
- && (size_t)TypeInfo[f->f_type].queue_size > f->f_qsize)) {
+ && (size_t)TypeInfo[f->f_type].queue_size <= f->f_qsize)) {
qentry = find_qentry_to_delete(&f->f_qhead, strategy, 0);
if (message_queue_remove(f, qentry))
removed++;
Home |
Main Index |
Thread Index |
Old Index