Skip to content

Commit 8cabd20

Browse files
committed
Merge branch 'mk/qnx'
Port to QNX. * mk/qnx: Port to QNX Make lock local to fetch_pack
2 parents 324dfac + 40036be commit 8cabd20

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ all::
8080
#
8181
# Define NO_MEMMEM if you don't have memmem.
8282
#
83+
# Define NO_GETPAGESIZE if you don't have getpagesize.
84+
#
8385
# Define NO_STRLCPY if you don't have strlcpy.
8486
#
8587
# Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the
@@ -1455,6 +1457,22 @@ else
14551457
NO_CURL = YesPlease
14561458
endif
14571459
endif
1460+
ifeq ($(uname_S),QNX)
1461+
COMPAT_CFLAGS += -DSA_RESTART=0
1462+
HAVE_STRINGS_H = YesPlease
1463+
NEEDS_SOCKET = YesPlease
1464+
NO_FNMATCH_CASEFOLD = YesPlease
1465+
NO_GETPAGESIZE = YesPlease
1466+
NO_ICONV = YesPlease
1467+
NO_MEMMEM = YesPlease
1468+
NO_MKDTEMP = YesPlease
1469+
NO_MKSTEMPS = YesPlease
1470+
NO_NSEC = YesPlease
1471+
NO_PTHREADS = YesPlease
1472+
NO_R_TO_GCC_LINKER = YesPlease
1473+
NO_STRCASESTR = YesPlease
1474+
NO_STRLCPY = YesPlease
1475+
endif
14581476

14591477
-include config.mak.autogen
14601478
-include config.mak
@@ -1872,6 +1890,9 @@ ifdef NO_MEMMEM
18721890
COMPAT_CFLAGS += -DNO_MEMMEM
18731891
COMPAT_OBJS += compat/memmem.o
18741892
endif
1893+
ifdef NO_GETPAGESIZE
1894+
COMPAT_CFLAGS += -DNO_GETPAGESIZE
1895+
endif
18751896
ifdef INTERNAL_QSORT
18761897
COMPAT_CFLAGS += -DINTERNAL_QSORT
18771898
COMPAT_OBJS += compat/qsort.o

fetch-pack.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,6 @@ static int fetch_pack_config(const char *var, const char *value, void *cb)
874874
return git_default_config(var, value, cb);
875875
}
876876

877-
static struct lock_file lock;
878-
879877
static void fetch_pack_setup(void)
880878
{
881879
static int did_setup;
@@ -917,6 +915,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
917915
ref_cpy = do_fetch_pack(args, fd, ref, sought, pack_lockfile);
918916

919917
if (args->depth > 0) {
918+
static struct lock_file lock;
920919
struct cache_time mtime;
921920
struct strbuf sb = STRBUF_INIT;
922921
char *shallow = git_path("shallow");

git-compat-util.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
# endif
7676
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
7777
!defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
78-
!defined(__TANDEM)
78+
!defined(__TANDEM) && !defined(__QNX__)
7979
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
8080
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
8181
#endif
@@ -413,6 +413,10 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
413413
const void *needle, size_t needlelen);
414414
#endif
415415

416+
#ifdef NO_GETPAGESIZE
417+
#define getpagesize() sysconf(_SC_PAGESIZE)
418+
#endif
419+
416420
#ifdef FREAD_READS_DIRECTORIES
417421
#ifdef fopen
418422
#undef fopen

0 commit comments

Comments
 (0)