X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=test%2Fudevd-test%2Fudev-log-script.pl;h=5d7ca7118158d6404306ab8ca75d0b0aedc84b52;hp=5f4f8a4495f7dafd55e523aa2d3c41517324a550;hb=077ed27c55a9ea661262d7b3ec8be184445ab82e;hpb=7d855c3116ec9ddab9adde96b568681930d9855b diff --git a/test/udevd-test/udev-log-script.pl b/test/udevd-test/udev-log-script.pl index 5f4f8a449..5d7ca7118 100644 --- a/test/udevd-test/udev-log-script.pl +++ b/test/udevd-test/udev-log-script.pl @@ -36,35 +36,11 @@ use strict; # modifiable settings my $log_file = "/tmp/udev_log.txt"; -# global variables -my $devpath; -my $action; -my $subsystem; - -# common functions -sub getDate { - # Get current date/time - # If we want GTM time, simply pass GMT as first argument to this function. - my $format = @_; - my $date; - - if( $format =~ /GMT/i ) { - $date = gmtime() . " GMT"; - } else { - $date = localtime(); - } - return $date; -} - -# main program if ($ARGV[0]) { - # prepare - $subsystem = $ARGV[0]; - $devpath = $ENV{DEVPATH}; - $action = $ENV{ACTION}; - - # Get current system date - my $time = getDate(); + my $subsystem = $ARGV[0]; + my $devpath = $ENV{DEVPATH}; + my $action = $ENV{ACTION}; + my $time = time(); # Logging if (open(LOGF, ">>$log_file")) {