summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-11-02 21:03:58 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-02 21:03:58 +0000
commitcf2bd34037cfff7e50c51556e807d3147a90963b (patch)
tree1076f70be6d87d244131eb6aefb3a69a83b8d1c2 /ext
parent1577bb166a95354d8198faf9da46ef504c9ebfd7 (diff)
downloadperl-cf2bd34037cfff7e50c51556e807d3147a90963b.tar.gz
Locate _PATH_LOG if it's a socket even if not #defined
(helps Tru64) From Paul David Fardy <pdf@morgan.ucs.mun.ca>, via Nicholas Clark. p4raw-id: //depot/perl@12818
Diffstat (limited to 'ext')
-rw-r--r--ext/Sys/Syslog/Makefile.PL10
-rwxr-xr-xext/Sys/Syslog/syslog.t18
2 files changed, 18 insertions, 10 deletions
diff --git a/ext/Sys/Syslog/Makefile.PL b/ext/Sys/Syslog/Makefile.PL
index d9f4e65c5e..1de0148d41 100644
--- a/ext/Sys/Syslog/Makefile.PL
+++ b/ext/Sys/Syslog/Makefile.PL
@@ -8,6 +8,14 @@ WriteMakefile(
XSPROTOARG => '-noprototypes',
realclean => {FILES=> 'constants.c constants.xs'},
);
+
+# We hope syslogd understands /dev/log.
+#
+# Solaris has a -c /dev/log, but the syslog.t #1 and #2 don't
+# seem to be happy if that's _PATH_LOG.
+#
+my $_PATH_LOG = -S "/dev/log" ? "/dev/log" : "";
+
WriteConstants(
NAME => 'Sys::Syslog',
NAMES => [qw(LOG_ALERT LOG_AUTH LOG_AUTHPRIV LOG_CONS LOG_CRIT LOG_CRON
@@ -17,6 +25,6 @@ WriteConstants(
LOG_MAIL LOG_NDELAY LOG_NEWS LOG_NFACILITIES LOG_NOTICE
LOG_NOWAIT LOG_ODELAY LOG_PERROR LOG_PID LOG_PRIMASK LOG_SYSLOG
LOG_USER LOG_UUCP LOG_WARNING),
- {name=>"_PATH_LOG", type=>"PV", default=>["PV", '""']},
+ {name=>"_PATH_LOG", type=>"PV", default=>["PV",qq("$_PATH_LOG")]},
],
);
diff --git a/ext/Sys/Syslog/syslog.t b/ext/Sys/Syslog/syslog.t
index 77aff13bb5..108d7e8a0b 100755
--- a/ext/Sys/Syslog/syslog.t
+++ b/ext/Sys/Syslog/syslog.t
@@ -25,7 +25,7 @@ BEGIN {
BEGIN {
eval {require Sys::Syslog} or do {
if ($@ =~ /Your vendor has not/) {
- print "1..0 # Skipped: missing macros\n";
+ print "1..0 # Skip: missing macros\n";
exit 0;
}
}
@@ -43,32 +43,32 @@ print "1..6\n";
if (Sys::Syslog::_PATH_LOG()) {
if (-e Sys::Syslog::_PATH_LOG()) {
- print defined(eval { setlogsock('unix') }) ? "ok 1\n" : "not ok 1\n";
- print defined(eval { openlog('perl', 'ndelay', 'local0') }) ? "ok 2\n" : "not ok 2\n";
- print defined(eval { syslog('info', $test_string ) }) ? "ok 3\n" : "not ok 3\n";
+ print defined(eval { setlogsock('unix') }) ? "ok 1\n" : "not ok 1 # $!\n";
+ print defined(eval { openlog('perl', 'ndelay', 'local0') }) ? "ok 2\n" : "not ok 2 # $!\n";
+ print defined(eval { syslog('info', $test_string ) }) ? "ok 3\n" : "not ok 3 # $!\n";
}
else {
for (1..3) {
print
- "ok $_ # skipping, file ",
+ "ok $_ # Skip: file ",
Sys::Syslog::_PATH_LOG(),
" does not exist\n";
}
}
}
else {
- for (1..3) { print "ok $_ # skipping, _PATH_LOG unavailable\n" }
+ for (1..3) { print "ok $_ # Skip: _PATH_LOG unavailable\n" }
}
if( $Test_Syslog_INET ) {
print defined(eval { setlogsock('inet') }) ? "ok 4\n"
: "not ok 4\n";
print defined(eval { openlog('perl', 'ndelay', 'local0') }) ? "ok 5\n"
- : "not ok 5\n";
+ : "not ok 5 # $!\n";
print defined(eval { syslog('info', $test_string ) }) ? "ok 6\n"
- : "not ok 6\n";
+ : "not ok 6 # $!\n";
}
else {
- print "ok $_ # skipped(assuming syslog doesn't accept inet connections)\n"
+ print "ok $_ # Skip: assuming syslog doesn't accept inet connections\n"
foreach (4..6);
}