print "1..6\n";
-if (Sys::Syslog::_PATH_LOG() and -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') }) ? "ok 3\n" : "not ok 3\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') }) ? "ok 3\n" : "not ok 3\n";
+ }
+ else {
+ for (1..3) {
+ print
+ "ok $_ # skipping, file ",
+ Sys::Syslog::_PATH_LOG(),
+ " does not exist\n";
+ }
+ }
}
else {
for (1..3) { print "ok $_ # skipping, _PATH_LOG unavailable\n" }