$error_code = 0;
$result = '';
unless ( $test ) {
- $result = `$CmdLine`;
- $error_code = $?;
+
+ {
+ local $SIG{'ALRM'} = sub { die "Timeout\n" };
+ alarm $timeout;
+ $result = `$CmdLine`;
+ $error_code = $?;
+ alarm 0;
+ }
+
+ if ( $@ ) {
+ error "Fehler: $@", "warning";
+ $error_code = 55;
+ }
+
}
if ( $error_code ) {
- error "Error in deleting SMS in SIM Location $i: " . $result, "warn";
+ error "Error in deleting SMS in SIM Location $i: " . $result, "warning";
} else {
debug "SMS in SIM Location $i successful deleted.";
}