Skip to content

Commit

Permalink
PathTools/Cwd.xs: define SYSNAME/SYSNAME_LEN for OS390 only
Browse files Browse the repository at this point in the history
This fixes the following warning on illumos based platforms:

    Cwd.xs:27:0: warning: "SYSNAME" redefined
     #define SYSNAME "$SYSNAME"

    In file included from ../../perl.h:1111:0,
                     from Cwd.xs:8:
    /usr/include/sys/param.h:184:0: note: this is the location of the previous definition
     #define SYSNAME 9  /* # chars in system name */
  • Loading branch information
mtelka committed Jun 28, 2022
1 parent 1e45e08 commit 132e84a
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -1147,6 +1147,7 @@ Marcel Grünauer <marcel@codewerk.com> Marcel Gruenauer <hanekomu@gmail.com>
Marcel Grünauer <marcel@codewerk.com> Marcel Grunauer <marcel@codewerk.com>
Marcel Grünauer <marcel@codewerk.com> Marcel Grünauer <gr@univie.ac.at>
Marcel Grünauer <marcel@codewerk.com> Marcel Grünauer <marcel@codewerk.com>
Marcel Telka <marcel@telka.sk> Marcel Telka <marcel@telka.sk>
Marco Fontani <mfontani@cpan.org> Marco Fontani <mfontani@cpan.org>
Marco Peereboom <marco@conformal.com> Marco Peereboom <marco@conformal.com>
Marcus Holland-Moritz <mhx-perl@gmx.net> Marcus Holland-Moritz <mhx-perl@gmx.net>
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -852,6 +852,7 @@ Marc Reisner <reisner.marc@gmail.com>
Marc Simpson <marc@0branch.com>
Marc-Philip Werner <marc-philip.werner@sap.com>
Marcel Grünauer <marcel@codewerk.com>
Marcel Telka <marcel@telka.sk>
Marco Fontani <MFONTANI@cpan.org>
Marco Peereboom <marco@conformal.com>
Marcus Holland-Moritz <mhx-perl@gmx.net>
Expand Down
4 changes: 4 additions & 0 deletions dist/PathTools/Changes
@@ -1,5 +1,9 @@
Revision history for Perl distribution PathTools.

3.86

- Fix compilation warning on illumos based platforms

3.85

- Fix issue related to tainting empty PATH
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/Cwd.pm
Expand Up @@ -3,7 +3,7 @@ use strict;
use Exporter;


our $VERSION = '3.85';
our $VERSION = '3.86';
my $xs_version = $VERSION;
$VERSION =~ tr/_//d;

Expand Down
6 changes: 4 additions & 2 deletions dist/PathTools/Cwd.xs
Expand Up @@ -24,8 +24,10 @@
#endif

/* For special handling of os390 sysplexed systems */
#ifdef OS390
#define SYSNAME "$SYSNAME"
#define SYSNAME_LEN (sizeof(SYSNAME) - 1)
#endif

/* The realpath() implementation from OpenBSD 3.9 to 4.2 (realpath.c 1.13)
* Renamed here to bsd_realpath() to avoid library conflicts.
Expand Down Expand Up @@ -202,7 +204,7 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
if (slen < 0)
return (NULL);
symlink[slen] = '\0';
# ifdef EBCDIC /* XXX Probably this should be only os390 */
# ifdef OS390
/* Replace all instances of $SYSNAME/foo simply by /foo */
if (slen > SYSNAME_LEN + strlen(next_token)
&& strnEQ(symlink, SYSNAME, SYSNAME_LEN)
Expand Down Expand Up @@ -245,7 +247,7 @@ bsd_realpath(const char *path, char resolved[MAXPATHLEN])
}
remaining_len = my_strlcpy(remaining, symlink, sizeof(remaining));
}
# ifdef EBCDIC
# ifdef OS390
not_symlink: ;
# endif
}
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec.pm
Expand Up @@ -2,7 +2,7 @@ package File::Spec;

use strict;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

my %module = (
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/AmigaOS.pm
Expand Up @@ -3,7 +3,7 @@ package File::Spec::AmigaOS;
use strict;
require File::Spec::Unix;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

our @ISA = qw(File::Spec::Unix);
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/Cygwin.pm
Expand Up @@ -3,7 +3,7 @@ package File::Spec::Cygwin;
use strict;
require File::Spec::Unix;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

our @ISA = qw(File::Spec::Unix);
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/Epoc.pm
Expand Up @@ -2,7 +2,7 @@ package File::Spec::Epoc;

use strict;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

require File::Spec::Unix;
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/Functions.pm
Expand Up @@ -3,7 +3,7 @@ package File::Spec::Functions;
use File::Spec;
use strict;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

require Exporter;
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/Mac.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use Cwd ();
require File::Spec::Unix;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

our @ISA = qw(File::Spec::Unix);
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/OS2.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use Cwd ();
require File::Spec::Unix;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

our @ISA = qw(File::Spec::Unix);
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/Unix.pm
Expand Up @@ -3,7 +3,7 @@ package File::Spec::Unix;
use strict;
use Cwd ();

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

=head1 NAME
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/VMS.pm
Expand Up @@ -4,7 +4,7 @@ use strict;
use Cwd ();
require File::Spec::Unix;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

our @ISA = qw(File::Spec::Unix);
Expand Down
2 changes: 1 addition & 1 deletion dist/PathTools/lib/File/Spec/Win32.pm
Expand Up @@ -5,7 +5,7 @@ use strict;
use Cwd ();
require File::Spec::Unix;

our $VERSION = '3.85';
our $VERSION = '3.86';
$VERSION =~ tr/_//d;

our @ISA = qw(File::Spec::Unix);
Expand Down

0 comments on commit 132e84a

Please sign in to comment.