Skip to content

Commit 9f2eba2

Browse files
committed
Merge branch 'rb/hpe'
Portability updates for the HPE NonStop platform. * rb/hpe: compat/regex/regcomp.c: define intptr_t and uintptr_t on NonStop git-compat-util.h: add FLOSS headers for HPE NonStop config.mak.uname: support for modern HPE NonStop config. transport-helper: drop read/write errno checks transport-helper: use xread instead of read
2 parents e805dc1 + 0bdaacf commit 9f2eba2

File tree

4 files changed

+47
-10
lines changed

4 files changed

+47
-10
lines changed

compat/regex/regcomp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
License along with the GNU C Library; if not, see
1818
<http://www.gnu.org/licenses/>. */
1919

20+
#if defined __TANDEM
21+
/* This is currently duplicated from git-compat-utils.h */
22+
# ifdef NO_INTPTR_T
23+
typedef long intptr_t;
24+
typedef unsigned long uintptr_t;
25+
# endif
26+
#endif
27+
2028
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
2129
size_t length, reg_syntax_t syntax);
2230
static void re_compile_fastmap_iter (regex_t *bufp,

config.mak.uname

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,26 +442,43 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
442442
# INLINE='' would just replace one set of warnings with another and
443443
# still not compile in c89 mode, due to non-const array initializations.
444444
CC = cc -c99
445+
# Build down-rev compatible objects that don't use our new getopt_long.
446+
ifeq ($(uname_R).$(uname_V),J06.21)
447+
CC += -WRVU=J06.20
448+
endif
449+
ifeq ($(uname_R).$(uname_V),L17.02)
450+
CC += -WRVU=L16.05
451+
endif
445452
# Disable all optimization, seems to result in bad code, with -O or -O2
446453
# or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
447454
# abends on "git push". Needs more investigation.
448-
CFLAGS = -g -O0
455+
CFLAGS = -g -O0 -Winline
449456
# We'd want it to be here.
450457
prefix = /usr/local
451-
# Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
452-
PERL_PATH = ${prefix}/bin/perl
453-
PYTHON_PATH = ${prefix}/bin/python
454-
458+
# perl and python must be in /usr/bin on NonStop - supplied by HPE
459+
# with operating system in that managed directory.
460+
PERL_PATH = /usr/bin/perl
461+
PYTHON_PATH = /usr/bin/python
462+
# The current /usr/coreutils/rm at lowest support level does not work
463+
# with the git test structure. Long paths as in
464+
# 'trash directory...' cause rm to terminate prematurely without fully
465+
# removing the directory at OS releases J06.21 and L17.02.
466+
# Default to the older rm until those two releases are deprecated.
467+
RM = /bin/rm -f
455468
# As detected by './configure'.
456469
# Missdetected, hence commented out, see below.
457470
#NO_CURL = YesPlease
458471
# Added manually, see above.
472+
NEEDS_SSL_WITH_CURL = YesPlease
473+
NEEDS_CRYPTO_WITH_SSL = YesPlease
474+
HAVE_DEV_TTY = YesPlease
459475
HAVE_LIBCHARSET_H = YesPlease
460476
HAVE_STRINGS_H = YesPlease
461477
NEEDS_LIBICONV = YesPlease
462478
NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
463479
NO_SYS_SELECT_H = UnfortunatelyYes
464480
NO_D_TYPE_IN_DIRENT = YesPlease
481+
NO_GETTEXT = YesPlease
465482
NO_HSTRERROR = YesPlease
466483
NO_STRCASESTR = YesPlease
467484
NO_MEMMEM = YesPlease
@@ -471,7 +488,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
471488
NO_MKDTEMP = YesPlease
472489
# Currently libiconv-1.9.1.
473490
OLD_ICONV = UnfortunatelyYes
474-
NO_REGEX = YesPlease
491+
NO_REGEX = NeedsStartEnd
475492
NO_PTHREADS = UnfortunatelyYes
476493

477494
# Not detected (nor checked for) by './configure'.

git-compat-util.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,19 @@ static inline char *git_find_last_dir_sep(const char *path)
398398
#define query_user_email() NULL
399399
#endif
400400

401+
#ifdef __TANDEM
402+
#include <floss.h(floss_execl,floss_execlp,floss_execv,floss_execvp)>
403+
#include <floss.h(floss_getpwuid)>
404+
#ifndef NSIG
405+
/*
406+
* NonStop NSE and NSX do not provide NSIG. SIGGUARDIAN(99) is the highest
407+
* known, by detective work using kill -l as a list is all signals
408+
* instead of signal.h where it should be.
409+
*/
410+
# define NSIG 100
411+
#endif
412+
#endif
413+
401414
#if defined(__HP_cc) && (__HP_cc >= 61000)
402415
#define NORETURN __attribute__((noreturn))
403416
#define NORETURN_PTR

transport-helper.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,9 +1226,8 @@ static int udt_do_read(struct unidirectional_transfer *t)
12261226
return 0; /* No space for more. */
12271227

12281228
transfer_debug("%s is readable", t->src_name);
1229-
bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
1230-
if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
1231-
errno != EINTR) {
1229+
bytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
1230+
if (bytes < 0) {
12321231
error_errno(_("read(%s) failed"), t->src_name);
12331232
return -1;
12341233
} else if (bytes == 0) {
@@ -1255,7 +1254,7 @@ static int udt_do_write(struct unidirectional_transfer *t)
12551254

12561255
transfer_debug("%s is writable", t->dest_name);
12571256
bytes = xwrite(t->dest, t->buf, t->bufuse);
1258-
if (bytes < 0 && errno != EWOULDBLOCK) {
1257+
if (bytes < 0) {
12591258
error_errno(_("write(%s) failed"), t->dest_name);
12601259
return -1;
12611260
} else if (bytes > 0) {

0 commit comments

Comments
 (0)