Browse Source

Added OS detection to getpwuid

Since getpwuid is not implemented on Windows
Alois Mahdal 11 years ago
parent
commit
9c25bae404
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      cgi-bin/hello_host.cgi

+ 1
- 1
cgi-bin/hello_host.cgi View File

@@ -21,7 +21,7 @@ my $myip = $ENV{'SERVER_ADDR'};
21 21
 my $myport = $ENV{'SERVER_PORT'};
22 22
 my $myhostname = hostname;
23 23
 my $mylocaltime = &mygetstrtime;
24
-my $username = getpwuid( $< );
24
+my $username = ( $^O eq "MSWin32" ? '' : getpwuid( $< ));
25 25
 
26 26
 print "Client:\n";
27 27
 print "  $ip:$port\n";