Merge branch 'rb/hpe'
authorJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2019 21:49:54 +0000 (13:49 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2019 21:49:54 +0000 (13:49 -0800)
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

1  2 
config.mak.uname
git-compat-util.h
transport-helper.c
diff --combined config.mak.uname
index e3914310418dac0ac5f6401ecc51fd848f068f5a,53d4ce578e7b9bcfc710e6d44138b4ef905e3491..7b36a1dfe7dc245ab0e9e9d431ee1d7c562915cb
@@@ -187,7 -187,7 +187,7 @@@ ifeq ($(uname_O),Cygwin
        UNRELIABLE_FSTAT = UnfortunatelyYes
        OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
        MMAP_PREVENTS_DELETE = UnfortunatelyYes
 -      COMPAT_OBJS += compat/cygwin.o
 +      COMPAT_OBJS += compat/win32/path-utils.o
        FREAD_READS_DIRECTORIES = UnfortunatelyYes
  endif
  ifeq ($(uname_S),FreeBSD)
@@@ -233,7 -233,6 +233,7 @@@ ifeq ($(uname_S),OpenBSD
        HAVE_BSD_SYSCTL = YesPlease
        HAVE_BSD_KERN_PROC_SYSCTL = YesPlease
        PROCFS_EXECUTABLE_PATH = /proc/curproc/file
 +      FREAD_READS_DIRECTORIES = UnfortunatelyYes
  endif
  ifeq ($(uname_S),MirBSD)
        NO_STRCASESTR = YesPlease
@@@ -442,26 -441,43 +442,43 @@@ ifeq ($(uname_S),NONSTOP_KERNEL
        # INLINE='' would just replace one set of warnings with another and
        # still not compile in c89 mode, due to non-const array initializations.
        CC = cc -c99
+       # Build down-rev compatible objects that don't use our new getopt_long.
+       ifeq ($(uname_R).$(uname_V),J06.21)
+               CC += -WRVU=J06.20
+       endif
+       ifeq ($(uname_R).$(uname_V),L17.02)
+               CC += -WRVU=L16.05
+       endif
        # Disable all optimization, seems to result in bad code, with -O or -O2
        # or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects
        # abends on "git push". Needs more investigation.
-       CFLAGS = -g -O0
+       CFLAGS = -g -O0 -Winline
        # We'd want it to be here.
        prefix = /usr/local
-       # Our's are in ${prefix}/bin (perl might also be in /usr/bin/perl).
-       PERL_PATH = ${prefix}/bin/perl
-       PYTHON_PATH = ${prefix}/bin/python
+       # perl and python must be in /usr/bin on NonStop - supplied by HPE
+       # with operating system in that managed directory.
+       PERL_PATH = /usr/bin/perl
+       PYTHON_PATH = /usr/bin/python
+       # The current /usr/coreutils/rm at lowest support level does not work
+       # with the git test structure. Long paths as in
+       # 'trash directory...' cause rm to terminate prematurely without fully
+       # removing the directory at OS releases J06.21 and L17.02.
+       # Default to the older rm until those two releases are deprecated.
+       RM = /bin/rm -f
        # As detected by './configure'.
        # Missdetected, hence commented out, see below.
        #NO_CURL = YesPlease
        # Added manually, see above.
+       NEEDS_SSL_WITH_CURL = YesPlease
+       NEEDS_CRYPTO_WITH_SSL = YesPlease
+       HAVE_DEV_TTY = YesPlease
        HAVE_LIBCHARSET_H = YesPlease
        HAVE_STRINGS_H = YesPlease
        NEEDS_LIBICONV = YesPlease
        NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease
        NO_SYS_SELECT_H = UnfortunatelyYes
        NO_D_TYPE_IN_DIRENT = YesPlease
+       NO_GETTEXT = YesPlease
        NO_HSTRERROR = YesPlease
        NO_STRCASESTR = YesPlease
        NO_MEMMEM = YesPlease
        NO_MKDTEMP = YesPlease
        # Currently libiconv-1.9.1.
        OLD_ICONV = UnfortunatelyYes
-       NO_REGEX = YesPlease
+       NO_REGEX = NeedsStartEnd
        NO_PTHREADS = UnfortunatelyYes
  
        # Not detected (nor checked for) by './configure'.
@@@ -528,7 -544,6 +545,7 @@@ ifneq (,$(findstring MINGW,$(uname_S))
        COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
        COMPAT_OBJS += compat/mingw.o compat/winansi.o \
 +              compat/win32/path-utils.o \
                compat/win32/pthread.o compat/win32/syslog.o \
                compat/win32/dirent.o
        BASIC_CFLAGS += -DWIN32 -DPROTECT_NTFS_DEFAULT=1
diff --combined git-compat-util.h
index b8ace774100649628863f0f7ce856e5a675c2c01,959eecfb0408e8f98fea473a269b710ace59a640..29a19902aaa00b90176e253c90c2384fca65857c
  #endif
  
  #if defined(__CYGWIN__)
 -#include "compat/cygwin.h"
 +#include "compat/win32/path-utils.h"
  #endif
  #if defined(__MINGW32__)
  /* pull in Windows compatibility stuff */
 +#include "compat/win32/path-utils.h"
  #include "compat/mingw.h"
  #elif defined(_MSC_VER)
  #include "compat/msvc.h"
@@@ -398,6 -397,19 +398,19 @@@ static inline char *git_find_last_dir_s
  #define query_user_email() NULL
  #endif
  
+ #ifdef __TANDEM
+ #include <floss.h(floss_execl,floss_execlp,floss_execv,floss_execvp)>
+ #include <floss.h(floss_getpwuid)>
+ #ifndef NSIG
+ /*
+  * NonStop NSE and NSX do not provide NSIG. SIGGUARDIAN(99) is the highest
+  * known, by detective work using kill -l as a list is all signals
+  * instead of signal.h where it should be.
+  */
+ # define NSIG 100
+ #endif
+ #endif
  #if defined(__HP_cc) && (__HP_cc >= 61000)
  #define NORETURN __attribute__((noreturn))
  #define NORETURN_PTR
@@@ -722,7 -734,7 +735,7 @@@ extern const char *githstrerror(int her
  #ifdef NO_MEMMEM
  #define memmem gitmemmem
  void *gitmemmem(const void *haystack, size_t haystacklen,
 -                const void *needle, size_t needlelen);
 +              const void *needle, size_t needlelen);
  #endif
  
  #ifdef OVERRIDE_STRDUP
diff --combined transport-helper.c
index 4702e150f0ef8f5f2253d64dad0abf6906867233,a87fdf7b0b30f3f131726b53f88f46dc9324806f..6cf3bb324e149c0180d332497edf2b2c15a6b71c
@@@ -1026,8 -1026,7 +1026,8 @@@ static int push_refs(struct transport *
  }
  
  
 -static int has_attribute(const char *attrs, const char *attr) {
 +static int has_attribute(const char *attrs, const char *attr)
 +{
        int len;
        if (!attrs)
                return 0;
@@@ -1226,9 -1225,8 +1226,8 @@@ static int udt_do_read(struct unidirect
                return 0;       /* No space for more. */
  
        transfer_debug("%s is readable", t->src_name);
-       bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
-       if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
-               errno != EINTR) {
+       bytes = xread(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
+       if (bytes < 0) {
                error_errno(_("read(%s) failed"), t->src_name);
                return -1;
        } else if (bytes == 0) {
@@@ -1255,7 -1253,7 +1254,7 @@@ static int udt_do_write(struct unidirec
  
        transfer_debug("%s is writable", t->dest_name);
        bytes = xwrite(t->dest, t->buf, t->bufuse);
-       if (bytes < 0 && errno != EWOULDBLOCK) {
+       if (bytes < 0) {
                error_errno(_("write(%s) failed"), t->dest_name);
                return -1;
        } else if (bytes > 0) {