Integrate mainline (for Arthurs thread.xs fix)
Nick Ing-Simmons [Mon, 22 Oct 2001 19:08:35 +0000 (19:08 +0000)]
p4raw-id: //depot/perlio@12579

ext/threads/threads.xs
lib/Net/Domain.pm
t/TEST
t/op/groups.t

index b2fa87e..6d8394f 100755 (executable)
@@ -91,7 +91,7 @@ SV* Perl_thread_create(char* class, SV* init_function, SV* params) {
        obj = newSVrv(obj_ref, class);
        sv_setiv(obj, (IV)thread);
        SvREADONLY_on(obj);
-
+       PerlIO_flush((PerlIO*)NULL);
        current_perl = PERL_GET_CONTEXT;        
 
        /*
index 03c24da..bd57996 100644 (file)
@@ -224,13 +224,14 @@ sub domainname {
     # eleminate DNS lookups
 
     return $fqdn = $host . "." . $domain
-       if($host !~ /\./ && $domain =~ /\./);
+       if(defined $host && defined $domain &&
+          $host !~ /\./ && $domain =~ /\./);
 
     # For hosts that have no name, just an IP address
-    return $fqdn = $host if $host =~ /^\d+(\.\d+){3}$/;
+    return $fqdn = $host if defined $host && $host =~ /^\d+(\.\d+){3}$/;
 
-    my @host   = split(/\./, $host);
-    my @domain = split(/\./, $domain);
+    my @host   = defined $host   ? split(/\./, $host)   : ('localhost');
+    my @domain = defined $domain ? split(/\./, $domain) : ();
     my @fqdn   = ();
 
     # Determine from @host & @domain the FQDN
diff --git a/t/TEST b/t/TEST
index b27bb07..ef3e478 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -321,9 +321,9 @@ SHRDLU
    ### You may have to set your dynamic library search path,
    ### $Config{ldlibpthname}, to point to the build directory
    ### before running the harness-- depending on your shell style:
-   ###     setenv $Config{ldlibpthname} `pwd`; cd t; ./perl harness
-   ###     $Config{ldlibpthname}=`pwd`; export $Config{ldlibpthname}; cd t; ./perl harness
-   ###     export $Config{ldlibpthname}=`pwd`; cd t; ./perl harness
+   ###     setenv $Config{ldlibpthname} `pwd`:$Config{ldlibpthname}; cd t; ./perl harness
+   ###     $Config{ldlibpthname}=`pwd`:$Config{ldlibpthname}; export $Config{ldlibpthname}; cd t; ./perl harness
+   ###     export $Config{ldlibpthname}=`pwd`:$Config{ldlibpthname}; cd t; ./perl harness
    ### for csh-style shells, like tcsh; or for traditional/modern
    ### Bourne-style shells, like bash, ksh, and zsh, respectively.
 SHRDLU
index 3228729..8c14649 100755 (executable)
@@ -70,6 +70,10 @@ unless (eval { getgrgid(0); 1 }) {
     exit 0;
 }
 
+chomp($groups);
+
+print "# groups = $groups\n";
+
 # Remember that group names can contain whitespace, '-', et cetera.
 # That is: do not \w, do not \S.
 if ($groups =~ /groups=(.+)( [ug]id=|$)/) {
@@ -107,6 +111,8 @@ if ($^O eq 'cygwin') { # basegroup on Cygwin has id = 0.
 }
 $seen{$pwgid}++;
 
+print "# pwgid = $pwgid, pwgnam = $pwgnam\n";
+
 for (split(' ', $()) {
     next if $seen{$_}++;
     ($group) = getgrgid($_);
@@ -118,6 +124,8 @@ for (split(' ', $()) {
     }
 } 
 
+print "# gr = @gr\n";
+
 if ($^O =~ /^(?:uwin|solaris)$/) {
        # Or anybody else who can have spaces in group names.
        $gr1 = join(' ', grep(!$did{$_}++, sort split(' ', join(' ', @gr))));
@@ -127,7 +135,7 @@ if ($^O =~ /^(?:uwin|solaris)$/) {
 
 $gr2 = join(' ', grep(!$basegroup{$_}++, sort split(' ',$groups)));
 
-if ($gr1 eq $gr2) {
+if ($gr1 eq $gr2 || ($gr1 eq '' && $gr2 eq $pwgid)) {
     print "ok 1\n";
 }
 else {