X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2Ffindrfuncs;h=c9a7ff80a73d21e5df45506ca32ecb10044a497f;hb=8d4ff56f76907d1619ddc5fd7040d3823057ec47;hp=029bdd09807faba6754587c2c77914ba8c5ee57c;hpb=10bc17b68c7666cd045658934ccb75dd788c8972;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/findrfuncs b/Porting/findrfuncs index 029bdd0..c9a7ff8 100644 --- a/Porting/findrfuncs +++ b/Porting/findrfuncs @@ -1,11 +1,14 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -ws # # findrfuncs: find reentrant variants of functions used in an executable. +# # Requires a functional "nm -u". Searches headers in /usr/include # to find available *_r functions and looks for non-reentrant # variants used in the supplied executable. # +# Requires debug info in the shared libraries/executables. +# # Gurusamy Sarathy # gsar@ActiveState.com # @@ -66,6 +69,8 @@ my $netdb_r_obsolete; if ($^O eq 'hpux') { delete $rfuncs{crypt_r}; delete $rfuncs{drand48_r}; + delete $rfuncs{endgrent_r}; + delete $rfuncs{endpwent_r}; delete $rfuncs{getgrent_r}; delete $rfuncs{getpwent_r}; delete $rfuncs{setlocale_r}; @@ -104,12 +109,12 @@ my %syms; for my $exe (@EXES) { # warn "#--- $exe\n"; - for my $sym (`$NMU $exe`) { + for my $sym (`$NMU $exe 2>/dev/null`) { chomp $sym; $sym =~ s/^\s+//; $sym =~ s/^([0-9A-Fa-f]+\s+)?[Uu]\s+//; $sym =~ s/\s+[Uu]\s+-$//; - next if /\s/; + next if $sym =~ /\s/; $sym =~ s/\@.*\z//; # remove @@GLIBC_2.0 etc # warn "#### $sym\n"; if (exists $rfuncs{"${sym}_r"} && ! $syms{"$sym:$exe"}++) { @@ -126,4 +131,3 @@ for my $exe (@EXES) { } @syms = (); } -