Updated VersionCheck and Pingback to work on Windows

This commit is contained in:
Brian Fraser
2012-09-20 10:54:55 -03:00
parent 2a220c6677
commit 787718121f
2 changed files with 6 additions and 5 deletions

View File

@@ -314,7 +314,7 @@ sub update_checks_file {
sub _touch { sub _touch {
my ($file) = @_; my ($file) = @_;
sysopen my $fh, $file, O_WRONLY|O_CREAT|O_NONBLOCK sysopen my $fh, $file, O_WRONLY|O_CREAT
or die "Cannot create $file : $!"; or die "Cannot create $file : $!";
close $fh or die "Cannot close $file : $!"; close $fh or die "Cannot close $file : $!";
utime(undef, undef, $file); utime(undef, undef, $file);

View File

@@ -125,12 +125,13 @@ sub valid_item {
sub get_os_version { sub get_os_version {
my ($self) = @_; my ($self) = @_;
chomp(my $platform = `uname -s`); if ( $OSNAME eq 'MSWin32' ) {
PTDEBUG && _d('platform:', $platform); require Win32;
if ( !$platform ) {
return $OSNAME if $OSNAME ne 'MSWin32';
return Win32::GetOSDisplayName(); return Win32::GetOSDisplayName();
} }
chomp(my $platform = `uname -s`);
PTDEBUG && _d('platform:', $platform);
return $OSNAME unless $platform; return $OSNAME unless $platform;
chomp(my $lsb_release chomp(my $lsb_release