diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-09-03 15:56:08 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-09-03 15:56:08 +0000 |
commit | 84376fdb94d04453466a113db08ae41ac993c794 (patch) | |
tree | aae1b7e6791560c9a2c490f558da178061cd28f6 /regress/usr.sbin/syslogd/funcs.pl | |
parent | 9547d7b39ca5a0f8037f6701500226fefa32dc0a (diff) |
Add tests that send log messages via unix domain sockets to syslogd.
Also check that the maximum number of -a path is handled correctly.
Diffstat (limited to 'regress/usr.sbin/syslogd/funcs.pl')
-rw-r--r-- | regress/usr.sbin/syslogd/funcs.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/regress/usr.sbin/syslogd/funcs.pl b/regress/usr.sbin/syslogd/funcs.pl index 6e18fb2e111..423a54ab9b3 100644 --- a/regress/usr.sbin/syslogd/funcs.pl +++ b/regress/usr.sbin/syslogd/funcs.pl @@ -1,4 +1,4 @@ -# $OpenBSD: funcs.pl,v 1.5 2014/09/02 17:43:29 bluhm Exp $ +# $OpenBSD: funcs.pl,v 1.6 2014/09/03 15:56:07 bluhm Exp $ # Copyright (c) 2010-2014 Alexander Bluhm <bluhm@openbsd.org> # @@ -68,6 +68,19 @@ sub write_shutdown { syslog(LOG_NOTICE, $downlog); } +sub write_unix { + my $self = shift; + my $path = shift || "/dev/log"; + + my $u = IO::Socket::UNIX->new( + Type => SOCK_DGRAM, + Peer => $path, + ) or die ref($self), " connect to $path unix socket failed: $!"; + my $msg = get_log(). " $path unix socket"; + print $u $msg; + print STDERR $msg, "\n"; +} + ######################################################################## # Server funcs ######################################################################## |