Remove the new line prefixes from various error messages.
The logger automatically will take care of this.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
# Create the main queue. It is used to store and process all events which are
# reported and enqueued by the worker threads.
-my $queue :shared = new Thread::Queue or die "Could not create new, empty queue. $!\n";;
+my $queue :shared = new Thread::Queue or die "Could not create new, empty queue. $!";;
# Array to store all currently running worker objects.
# (Does not include the socket thread)
$SIG{'KILL'} = sub { threads->exit(); };
# Create inotify watcher.
- my $watcher = new Linux::Inotify2 or die "Could not use inotify. $!\n";
+ my $watcher = new Linux::Inotify2 or die "Could not use inotify. $!";
# Monitor the specified file.
- $watcher->watch("$file", IN_MODIFY) or die "Could not monitor $file. $!\n";
+ $watcher->watch("$file", IN_MODIFY) or die "Could not monitor $file. $!";
# Switch watcher into non-blocking mode.
$watcher->blocking(0);
my $fileposition = $monitored_files{$file};
# Open the file.
- open (FILE, $file) or die "Could not open $file. $!\n";
+ open (FILE, $file) or die "Could not open $file. $!";
# Seek to the last known position.
seek (FILE, $fileposition, 0);
my $file = $_[0];
# Open the file.
- open(FILE, $file) or die "Could not open $file. $!\n";
+ open(FILE, $file) or die "Could not open $file. $!";
# Just seek to the end of the file (EOF).
seek(FILE, 0, 2);
# If an error message is returned, exit and print the error message.
} else {
- die "Invalid configuration: $error\n";
+ die "Invalid configuration: $error";
}
}
# Check if the configfile exists and is read-able.
unless (-r "$file") {
- die "The given configfile ($file) does not exist, or is not read-able: $!\n";
+ die "The given configfile ($file) does not exist, or is not read-able: $!";
}
# Open the config file and read-in all configuration options and values.
- open(CONF, "$file") or die "Could not open $file: $!\n";
+ open(CONF, "$file") or die "Could not open $file: $!";
# Process line by line.
while (my $line = <CONF>) {
# If the path for the socketfile does not exist, try to
# create it.
unless (-d "$socketpath") {
- mkdir("$socketpath") or die "Could not create $socketpath: $!\n";
+ mkdir("$socketpath") or die "Could not create $socketpath: $!";
}
# Delete an existing socket file.
if (-e "$socketfile") {
unlink $socketfile
- or die "Could not release existing socket file: $!\n";
+ or die "Could not release existing socket file: $!";
}
# Create a new UNIX socket.
Local => $socketfile,
Listen => SOMAXCONN,
Type => SOCK_STREAM,
- ) or die "Could not create socket: $!\n";
+ ) or die "Could not create socket: $!";
# Return the server object.
return $server;