From 83ce82502de476ebe392fcfdbd3a68d2eb01e100 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 15 Apr 2021 17:45:12 -0700 Subject: [PATCH] Exit fast if at directory doesn't exist https://sourceforge.net/p/webadmin/bugs/5479/ --- at/freebsd-lib.pl | 2 +- at/irix-lib.pl | 2 +- at/linux-lib.pl | 2 +- at/macos-lib.pl | 2 +- at/openserver-lib.pl | 2 +- at/solaris-lib.pl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/at/freebsd-lib.pl b/at/freebsd-lib.pl index 76bbb0bf0..c30d1fd61 100755 --- a/at/freebsd-lib.pl +++ b/at/freebsd-lib.pl @@ -6,7 +6,7 @@ our (%config); sub list_atjobs { my @rv; -opendir(my $DIR, $config{'at_dir'}); +opendir(my $DIR, $config{'at_dir'}) || return (); while(my $f = readdir($DIR)) { my $p = "$config{'at_dir'}/$f"; if ($f =~ /^c(\S{5})(\S+)$/) { diff --git a/at/irix-lib.pl b/at/irix-lib.pl index 61f154f96..1fb5a9ab6 100755 --- a/at/irix-lib.pl +++ b/at/irix-lib.pl @@ -5,7 +5,7 @@ use POSIX; sub list_atjobs { local @rv; -opendir(DIR, $config{'at_dir'}); +opendir(DIR, $config{'at_dir'}) || return (); while($f = readdir(DIR)) { local $p = "$config{'at_dir'}/$f"; if ($f =~ /^(\d+)\.a$/) { diff --git a/at/linux-lib.pl b/at/linux-lib.pl index 0010658f1..6dff245a8 100755 --- a/at/linux-lib.pl +++ b/at/linux-lib.pl @@ -6,7 +6,7 @@ our (%config); sub list_atjobs { my @rv; -opendir(my $DIR, $config{'at_dir'}); +opendir(my $DIR, $config{'at_dir'}) || return (); while(my $f = readdir($DIR)) { my $p = "$config{'at_dir'}/$f"; if ($f =~ /^a(\S{5})(\S+)$/) { diff --git a/at/macos-lib.pl b/at/macos-lib.pl index 2297e66fa..63c718c12 100755 --- a/at/macos-lib.pl +++ b/at/macos-lib.pl @@ -6,7 +6,7 @@ our %config; sub list_atjobs { my @rv; -opendir(my $DIR, $config{'at_dir'}); +opendir(my $DIR, $config{'at_dir'}) || return (); while(my $f = readdir($DIR)) { my $p = "$config{'at_dir'}/$f"; if ($f =~ /^a(\S+)\.(\d+)$/) { diff --git a/at/openserver-lib.pl b/at/openserver-lib.pl index 43e60fb98..6a9088ad7 100755 --- a/at/openserver-lib.pl +++ b/at/openserver-lib.pl @@ -5,7 +5,7 @@ use POSIX; sub list_atjobs { local @rv; -opendir(DIR, $config{'at_dir'}); +opendir(DIR, $config{'at_dir'}) || return (); while($f = readdir(DIR)) { local $p = "$config{'at_dir'}/$f"; if ($f =~ /^(\d+)\.a(\S+)$/) { diff --git a/at/solaris-lib.pl b/at/solaris-lib.pl index 456b10ea9..6a2b3580a 100755 --- a/at/solaris-lib.pl +++ b/at/solaris-lib.pl @@ -8,7 +8,7 @@ use POSIX; sub list_atjobs { my @rv; -opendir(my $DIR, $config{'at_dir'}); +opendir(my $DIR, $config{'at_dir'}) || return (); while(my $f = readdir($DIR)) { my $p = "$config{'at_dir'}/$f"; if ($f =~ /^(\d+)\.a$/) {