Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143907706
D51356.id158626.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D51356.id158626.diff
View Options
diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c
--- a/contrib/bsnmp/snmpd/main.c
+++ b/contrib/bsnmp/snmpd/main.c
@@ -42,6 +42,7 @@
#include <sys/un.h>
#include <sys/ucred.h>
#include <sys/uio.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
@@ -1509,7 +1510,7 @@
{
int opt;
FILE *fp;
- int background = 1;
+ bool background = true;
struct tport *p;
const char *prefix = "snmpd";
struct lmodule *m;
@@ -1526,11 +1527,6 @@
NULL
};
- snmp_printf = snmp_printf_func;
- snmp_error = snmp_error_func;
- snmp_debug = snmp_debug_func;
- asn_error = asn_error_func;
-
while ((opt = getopt(argc, argv, "c:dD:e:hI:l:m:p:")) != EOF)
switch (opt) {
@@ -1539,7 +1535,7 @@
break;
case 'd':
- background = 0;
+ background = false;
break;
case 'D':
@@ -1601,6 +1597,13 @@
break;
}
+ if (background) {
+ snmp_printf = snmp_printf_func;
+ snmp_error = snmp_error_func;
+ snmp_debug = snmp_debug_func;
+ asn_error = asn_error_func;
+ }
+
openlog(prefix, LOG_PID | (background ? 0 : LOG_PERROR), LOG_USER);
setlogmask(LOG_UPTO(debug.logpri - 1));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 2, 7:45 PM (10 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28411630
Default Alt Text
D51356.id158626.diff (1 KB)
Attached To
Mode
D51356: bsnmpd: in debugging mode (-d) use default library print/error functions
Attached
Detach File
Event Timeline
Log In to Comment