Index: distinfo =================================================================== --- distinfo (revision 161) +++ distinfo (revision 192) @@ -3,8 +3,8 @@ SHA1 (git-1.6.2.5.tar.gz) = f5214606f19c070b1163b8050efb98cf763dfa8c RMD160 (git-1.6.2.5.tar.gz) = c0882a36ddea53899ec215606d563f9937ddac84 Size (git-1.6.2.5.tar.gz) = 2450744 bytes -SHA1 (patch-aa) = dd10721b1c0ba6faab248114ea46ed801ad9d009 -SHA1 (patch-ab) = b8cbeacd7d44791a5151deaa97d1d283ac9296d1 +SHA1 (patch-aa) = 30135b3d0fba7f7fdc3b78ba8fbb95a3f72f269e +SHA1 (patch-ab) = b78c6caccf032b12ed5d9e43c41c2747a702a1a4 SHA1 (patch-ac) = ae75c6ca3abb5edf688e4877f3df8b6c6297f091 SHA1 (patch-ad) = 50def978931bd72c0ad86cebcafc2dd68a06f578 SHA1 (patch-ae) = 06ea26658a986dc702c1c2c04c1a27f0a01e4dce Index: files/qnxnto.c =================================================================== --- files/qnxnto.c (revision 0) +++ files/qnxnto.c (revision 192) @@ -0,0 +1,72 @@ +#include "qnxnto.h" +#undef sigaction + +#include +#include +#include +#include +#include + +static void * +restart_thread(void *arg) +{ + for (;;) + pause(); +} + +static pthread_t +startit(void) +{ + sigset_t fullset, oset; + int ret; + pthread_t tid; + + /* Start restart thread with all signals blocked */ + sigfillset(&fullset); + pthread_sigmask(SIG_BLOCK, &fullset, &oset); + + if ((ret = pthread_create(&tid, NULL, restart_thread, + NULL)) != EOK) { + tid = 0; + errno = ret; + } + + /* restore */ + pthread_sigmask(SIG_SETMASK, &oset, NULL); + + return tid; +} + +int +sigaction_qnx(int sig, const struct sigaction *act, struct sigaction *oact) +{ + static pthread_t restart_tid; + sigset_t nset, oset; + struct sigaction act_new; + + sigemptyset(&nset); + sigaddset(&nset, sig); + + if (act->sa_flags & SA_RESTART) { + if (restart_tid == 0 && (restart_tid = startit()) == 0) { + return -1; + } + + /* Block in calling thread */ + pthread_sigmask(SIG_BLOCK, &nset, NULL); + + /* Make sure unblocked in restart thread if not already */ + SignalProcmask_r(0, restart_tid, SIG_UNBLOCK, &nset, NULL); + + act_new = *act; + act_new.sa_flags &= ~SA_RESTART; + act = &act_new; + } + else if (restart_tid != 0) { + /* Unblock in calling thread */ + pthread_sigmask(SIG_UNBLOCK, &nset, NULL); + /* Block in restart thread */ + SignalProcmask_r(0, restart_tid, SIG_BLOCK, &nset, NULL); + } + return sigaction(sig, act, oact); +} Index: files/qnxnto.h =================================================================== --- files/qnxnto.h (revision 0) +++ files/qnxnto.h (revision 192) @@ -0,0 +1,10 @@ + +#include + +#ifndef SA_RESTART +#define SA_RESTART 0x0040 + +int sigaction_qnx(int, const struct sigaction *, struct sigaction *); + +#define sigaction(a, b, c) sigaction_qnx((a), (b), (c)) +#endif Index: patches/patch-ab =================================================================== --- patches/patch-ab (revision 161) +++ patches/patch-ab (revision 192) @@ -1,13 +1,23 @@ $NetBSD: patch-ab,v 1.4 2008/08/20 03:04:20 bjs Exp $ ---- git-compat-util.h.orig 2008-08-17 16:43:06.000000000 -0400 +--- git-compat-util.h.orig 2009-05-04 11:27:58.000000000 -0500 +++ git-compat-util.h @@ -39,7 +39,7 @@ /* Approximation of the length of the decimal representation of this type. */ #define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1) -#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) -+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(__sun) ++#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(__sun) && !defined(__QNXNTO__) #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ #endif +@@ -90,6 +90,9 @@ + #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */ + #include + #define _ALL_SOURCE 1 ++#if defined(__QNXNTO__) ++#include "compat/qnxnto.h" ++#endif + #endif + #else /* __MINGW32__ */ + /* pull in Windows compatibility stuff */ Index: patches/patch-aa =================================================================== --- patches/patch-aa (revision 161) +++ patches/patch-aa (revision 192) @@ -1,6 +1,6 @@ $NetBSD: patch-aa,v 1.7 2009/05/05 06:21:16 minskim Exp $ ---- Makefile.orig 2009-03-04 08:18:50.000000000 +0000 +--- Makefile.orig 2009-05-04 11:27:58.000000000 -0500 +++ Makefile @@ -230,12 +230,8 @@ GITWEB_SITE_FOOTER = @@ -15,7 +15,7 @@ RPMBUILD = rpmbuild TCL_PATH = tclsh TCLTK_PATH = wish -@@ -659,9 +655,10 @@ ifeq ($(uname_S),Darwin) +@@ -657,9 +653,10 @@ ifeq ($(uname_S),Darwin) THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),SunOS) @@ -27,7 +27,7 @@ NO_STRCASESTR = YesPlease NO_MEMMEM = YesPlease NO_HSTRERROR = YesPlease -@@ -679,8 +676,6 @@ ifeq ($(uname_S),SunOS) +@@ -677,8 +674,6 @@ ifeq ($(uname_S),SunOS) NO_C99_FORMAT = YesPlease NO_STRTOUMAX = YesPlease endif @@ -36,7 +36,7 @@ BASIC_CFLAGS += -D__EXTENSIONS__ endif ifeq ($(uname_O),Cygwin) -@@ -722,9 +717,7 @@ ifeq ($(uname_S),OpenBSD) +@@ -720,9 +715,7 @@ ifeq ($(uname_S),OpenBSD) THREADED_DELTA_SEARCH = YesPlease endif ifeq ($(uname_S),NetBSD) @@ -47,7 +47,18 @@ BASIC_CFLAGS += -I/usr/pkg/include BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib THREADED_DELTA_SEARCH = YesPlease -@@ -1116,7 +1109,7 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_P +@@ -826,6 +819,10 @@ ifeq ($(uname_S),Darwin) + endif + PTHREAD_LIBS = + endif ++ifneq (,$(findstring QNX,$(uname_S))) ++ COMPAT_OBJS += compat/qnxnto.o ++ PTHREAD_LIBS = ++endif + + ifndef CC_LD_DYNPATH + ifdef NO_R_TO_GCC_LINKER +@@ -1114,7 +1111,7 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_P PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) @@ -56,7 +67,7 @@ BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \ $(COMPAT_CFLAGS) -@@ -1452,10 +1445,10 @@ gitexec_instdir_SQ = $(subst ','\'',$(gi +@@ -1450,10 +1447,10 @@ gitexec_instdir_SQ = $(subst ','\'',$(gi export gitexec_instdir install: all Index: Makefile =================================================================== --- Makefile (revision 161) +++ Makefile (revision 192) @@ -79,6 +79,11 @@ SUBST_STAGE.fix-paths= pre-build SUBST_VARS.fix-paths= PREFIX +.if ${OPSYS} == "QNX" +post-patch: + ${CP} ${FILESDIR}/qnxnto.c ${FILESDIR}/qnxnto.h ${WRKSRC}/compat/ +.endif + #.include "../../editors/emacs/modules.mk" # XXX TODO (see patch-ad) .include "options.mk"