Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

11 messages, 7 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Jeremy Maitin-Shepard <hidden>
Date: 2016-06-15 22:44:42

Boyd Lynn Gerber [off-list ref] writes:

[snip]
quoted hunk
diff --git a/progress.c b/progress.c
index d19f80c..11a0841 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const
char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
+		char *buf = malloc (strlen(msg) + 5 );
This change will result in the allocated memory being leaked, which is
probably not correct.  Perhaps change it to alloca instead.

-- 
Jeremy Maitin-Shepard

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Boyd Lynn Gerber <hidden>
Date: 2016-06-15 22:44:42

On Fri, 6 Jun 2008, Jeremy Maitin-Shepard wrote:
This change will result in the allocated memory being leaked, which is
probably not correct.  Perhaps change it to alloca instead.
OK below is a new version with the suggestions.

--
Boyd Gerber [off-list ref]
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047

---------------------------------New-Submittal-------------------------
From 554045d534dfa89f01fc6b0a819c73ad660f02fb Fri Jun  6 14:01:55 MDT 2008
From: Boyd Lynn Gerber <redacted>
Date: Fri, 6 Jun 2008 13:58:04 -0600
Subject: [PATCH] This patch is to allow 12 different OS's to compile and run git.

This patch has patches to

Makefile
git-compat-util.h
progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
and OpenServer 6.0.X to build and run git.

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: Boyd Lynn Gerber <redacted>

--
Boyd Gerber [off-list ref]
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
diff --git a/Makefile b/Makefile
index cce5a6e..6df008a 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+  ifeq ($(uname_R),3.2)
+#    CFLAGS = -g -O2
+    CFLAGS = -g
+  endif
+  ifeq ($(uname_R),5)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
+  endif
+endif
+ifeq ($(uname_S),UnixWare)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -207,7 +221,8 @@ GITWEB_SITE_FOOTER =
 
 export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
 
-CC = gcc
+#CC = gcc
+CC = "cc"
 AR = ar
 RM = rm -f
 TAR = tar
@@ -564,6 +579,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+#	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+      ifeq ($(uname_R),5)
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+      endif
+#	BASIC_CFLAGS += -I/usr/local/include
+#	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..f27aea3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,8 @@
 /* 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__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #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
diff --git a/progress.c b/progress.c
index d19f80c..295c4e3 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
+		char *buf = alloca (strlen(msg) + 5 );
 		struct throughput *tp = progress->throughput;
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
-- 
1.5.2.4

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Stephan Beyer <hidden>
Date: 2016-06-15 22:44:42

Hi,
        Developer's Certificate of Origin 1.1
It's not necessary, or even unwanted, to copy&paste this into the
commit message.

The Signed-off-by: line
Signed-off-by: Boyd Lynn Gerber <redacted>
is enough.
So just use the Signed-off-by line and not the whole DCO.

As Documentation/SubmittingPatches says:
----
The sign-off is a simple line at the end of the explanation for
the patch[...].
[...]
if you can certify the below:

        Developer's Certificate of Origin 1.1
	[...]

then you just add a line saying

        Signed-off-by: Random J Developer [off-list ref]
----

Regards,
  Stephan

-- 
Stephan Beyer [off-list ref], PGP 0x6EDDD207FCC5040F

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:44:42


On Fri, 6 Jun 2008, Stephan Beyer wrote:
It's not necessary, or even unwanted, to copy&paste this into the
commit message.
Considering the particular OS's it adds support for and Boyd's 
geographical location, I suspect Boyd is pretty used to by now having to 
make _very_ clear to people that he understands the GPL and has the right 
to post the changes.

Sometimes a little bit of extra clarity is a good thing.

			Linus

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Boyd Lynn Gerber <hidden>
Date: 2016-06-15 22:44:42

On Fri, 6 Jun 2008, Linus Torvalds wrote:
On Fri, 6 Jun 2008, Stephan Beyer wrote:
quoted
It's not necessary, or even unwanted, to copy&paste this into the 
commit message.
Considering the particular OS's it adds support for and Boyd's 
geographical location, I suspect Boyd is pretty used to by now having to 
make _very_ clear to people that he understands the GPL and has the 
right to post the changes.

Sometimes a little bit of extra clarity is a good thing.
You hit the nail on the head.  I get tired of doing exactly that.  Just 
south of me 20-40 miles is the location of SCO Lindon, Utah.  I have to 
make it really clear in most things I do that I understand and totally 
support the GPL.  I have done work for said group and always add in my 
contracts that what is being done has to support the GPL and strict 
compliance is necessary.  All changes will be sent upstream for inclusion 
at the project head.  Whether they are added or not is really not the 
issue.  I want any and all changes to follow what ever licence they are 
under and everything has to be in compliance with the licences.

Thanks,

--
Boyd Gerber [off-list ref]
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Brandon Casey <hidden>
Date: 2016-06-15 22:44:42

Boyd Lynn Gerber wrote:
On Fri, 6 Jun 2008, Jeremy Maitin-Shepard wrote:
quoted
This change will result in the allocated memory being leaked, which is
probably not correct.  Perhaps change it to alloca instead.
OK below is a new version with the suggestions.

Comments below basically amount to:

  1) Use tab when indenting.
  2) Remove commented-out dead code
  3) Don't put space between function name and open parenthesis.

quoted hunk
diff --git a/Makefile b/Makefile
index cce5a6e..6df008a 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,20 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+  ifeq ($(uname_R),3.2)
Indent with a tab not 2 spaces.
+#    CFLAGS = -g -O2
These commented out assignments should not be included in the final patch.
+    CFLAGS = -g
Use tab.
+  endif
+  ifeq ($(uname_R),5)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
ditto on comment and tab.
+  endif
+endif
+ifeq ($(uname_S),UnixWare)
+    CFLAGS = -g -O2 -Wall
+#    CFLAGS = -g -O2
ditto
quoted hunk
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -207,7 +221,8 @@ GITWEB_SITE_FOOTER =
 
 export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
 
-CC = gcc
+#CC = gcc
+CC = "cc"
This one is up to Junio. Perhaps he has some reason for specifically configuring
gcc. In which case this CC selection maybe should go in the UnixWare section.
quoted hunk
 AR = ar
 RM = rm -f
 TAR = tar
@@ -564,6 +579,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
Commented out. Why is it in the patch?
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
ummhmm.
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+#	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+#	NO_HSTRERROR = YesPlease
+#	BASIC_CFLAGS +=  -E -H
+      ifeq ($(uname_R),5)
tabs
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+      endif
tab.
+#	BASIC_CFLAGS += -I/usr/local/include
+#	BASIC_LDFLAGS += -L/usr/local/lib
quoted hunk
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..f27aea3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,8 @@
 /* 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__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #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
diff --git a/progress.c b/progress.c
index d19f80c..295c4e3 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
       This should just be deleted.
+		char *buf = alloca (strlen(msg) + 5 );
                                  ^
       we don't put spaces between function name and open parens.


-brandon

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:42

Boyd Lynn Gerber [off-list ref] writes:
quoted hunk
diff --git a/progress.c b/progress.c
index d19f80c..295c4e3 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
+		char *buf = alloca (strlen(msg) + 5 );
 		struct throughput *tp = progress->throughput;
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
I do not know the situation over there these days, but I have a distant
but bitter memory of having to deal with AIX X-<.  It insisted that
inclusion of <alloca.h> to be the very first thing in the source before
anything else.  I would want to keep alloca() out of the codebase without
very good reason.  Not that I care much about portability to AIX, but not
having to worry about alloca() unless necessary is a good thing.

I do not think progress_msg() is a good reason to even worrying about a
dynamically sized array.  The function is designed to spit out a single
line of message (so the incoming msg is expected to be shorter than 80
chars or so).  If you "git grep stop_progress_msg", you will see that
there are only two callers of this function, one in progress.c itself that
says "done", and the other one in index-pack.c that gives a string
formatted into 48-byte buffer.

So we can be lazy and say:

	char buf[128];
        ...
        snprintf(buf, sizeof(buf), ", %s.\n", msg)

and be done with it.

If you really wanted to be safe and anal, you could do something like
this, which would be just as efficient and much more straightforward:

 progress.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);

Re: [PATCH] This patch is to allow 12 different OS's to compile and run git.

From: Boyd Lynn Gerber <hidden>
Date: 2016-06-15 22:44:42

On Fri, 6 Jun 2008, Junio C Hamano wrote:
Boyd Lynn Gerber [off-list ref] writes:
quoted
diff --git a/progress.c b/progress.c
index d19f80c..295c4e3 100644
--- a/progress.c
+++ b/progress.c
@@ -241,7 +241,8 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		/* char buf[strlen(msg) + 5]; */
+		char *buf = alloca (strlen(msg) + 5 );
 		struct throughput *tp = progress->throughput;
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
I do not know the situation over there these days, but I have a distant
but bitter memory of having to deal with AIX X-<.  It insisted that
inclusion of <alloca.h> to be the very first thing in the source before
anything else.  I would want to keep alloca() out of the codebase without
very good reason.  Not that I care much about portability to AIX, but not
having to worry about alloca() unless necessary is a good thing.
You hit the nail on the head, AIX and any Novell derived Compiler code 
requires it.  Also the SCO OS's
 
I do not think progress_msg() is a good reason to even worrying about a
dynamically sized array.  The function is designed to spit out a single
line of message (so the incoming msg is expected to be shorter than 80
chars or so).  If you "git grep stop_progress_msg", you will see that
there are only two callers of this function, one in progress.c itself that
says "done", and the other one in index-pack.c that gives a string
formatted into 48-byte buffer.

So we can be lazy and say:

	char buf[128];
        ...
        snprintf(buf, sizeof(buf), ", %s.\n", msg)

and be done with it.
I like the idea.
quoted hunk
If you really wanted to be safe and anal, you could do something like
this, which would be just as efficient and much more straightforward:

 progress.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
Thanks for the suggestions.  I am making changes based on all the feed 
back.  I will remove all the debug junk from the final patch.  I am 
putting options in and out a lot at the moment.  Trying to make sure I do 
not break anything on the 12 OS's.  It is a real pain testing all the 
changes on them to make sure I did not break anything.

Thanks,

--
Boyd Gerber [off-list ref]
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047

Re: [PATCH] 0002 This patch is to allow 12 different OS's to compile and run git.

From: Boyd Lynn Gerber <hidden>
Date: 2016-06-15 22:44:42

From db0574a7f89bb90b6ce02cd44053f8cec2c454cc
This patch has patches to

Makefile
git-compat-util.h
progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
and OpenServer 6.0.X to build and run git.  Applied suggestions from list.

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: Boyd Lynn Gerber <redacted>

--
Boyd Gerber [off-list ref]
ZENEZ   1042 East Fort Union #135, Midvale Utah  84047
diff --git a/Makefile b/Makefile
index cce5a6e..a0456c8 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,28 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+#	Change to -O2 for released version
+#	CFLAGS = -O2
+#	Debug Version
+		CFLAGS = -g
+	endif
+#	For System V based OS's
+	ifeq ($(uname_R),5)
+#	For System V based OS's and shared libraries
+		CFLAGS = -g -O2 -Wall
+#	Use for Static version
+#		CFLAGS = -g -O2
+	endif
+endif
+#	For all UnixWare Versions.
+ifeq ($(uname_S),UnixWare)
+#	For System V based OS's and shared libraries
+	CFLAGS = -g -O2 -Wall
+#	Use for Static version
+#	CFLAGS = -g -O2
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -564,6 +586,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS +=  -Kalloca -Kthread
+	endif
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..b3cd7b3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,12 @@
 /* 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__)
+/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
+   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
+   OpenServer 5.0.7  This is do avoided compiler hell like the other
+   OS's __APPLE__ and __FreeBSD__ */
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #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
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);
-- 
1.5.2.4

Re: [PATCH] 0002 This patch is to allow 12 different OS's to compile and run git.

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:44:42

On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
quoted hunk
From db0574a7f89bb90b6ce02cd44053f8cec2c454cc

This patch has patches to

Makefile
git-compat-util.h
progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
and OpenServer 6.0.X to build and run git.  Applied suggestions from list.

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: Boyd Lynn Gerber <redacted>

--
Boyd Gerber [off-list ref]
ZENEZ   1042 East Fort Union #135, Midvale Utah  84047
diff --git a/Makefile b/Makefile
index cce5a6e..a0456c8 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,28 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+#	Change to -O2 for released version
+#	CFLAGS = -O2
+#	Debug Version
+		CFLAGS = -g
+	endif
+#	For System V based OS's
+	ifeq ($(uname_R),5)
+#	For System V based OS's and shared libraries
+		CFLAGS = -g -O2 -Wall
You don't need this, because CFLAGS is already -g -O2 -Wall, since we set 
it above and couldn't have changed it.
+#	Use for Static version
+#		CFLAGS = -g -O2
Static libraries don't support -Wall?
+	endif
+endif
+#	For all UnixWare Versions.
+ifeq ($(uname_S),UnixWare)
+#	For System V based OS's and shared libraries
+	CFLAGS = -g -O2 -Wall
Again, this just sets it to what it must already be.

You might want to test something the person doing the build can put 
somewhere, rather than commenting out the lines you're not using.

	-Daniel
*This .sig left intentionally blank*

Re: [PATCH] 0003 This patch is to allow 12 different OS's to compile and run git.

From: Boyd Lynn Gerber <hidden>
Date: 2016-06-15 22:44:42

On Fri, 6 Jun 2008, Daniel Barkalow wrote:
On Fri, 6 Jun 2008, Boyd Lynn Gerber wrote:
quoted
From db0574a7f89bb90b6ce02cd44053f8cec2c454cc

This patch has patches to

Makefile
git-compat-util.h
progress.c

This patch allows some older OS's, SCO OpenServer 5.0.X, SCO UnixWare 7.1.4,
and OpenServer 6.0.X to build and run git.  Applied suggestions from list.

        Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (a) The contribution was created in whole or in part by me and I
            have the right to submit it under the open source license
            indicated in the file; or

        (b) The contribution is based upon previous work that, to the best
            of my knowledge, is covered under an appropriate open source
            license and I have the right under that license to submit that
            work with modifications, whether created in whole or in part
            by me, under the same open source license (unless I am
            permitted to submit under a different license), as indicated
            in the file; or

        (c) The contribution was provided directly to me by some other
            person who certified (a), (b) or (c) and I have not modified
            it.

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: Boyd Lynn Gerber <redacted>

--
Boyd Gerber [off-list ref]
ZENEZ   1042 East Fort Union #135, Midvale Utah  84047
OK made changes you recommended.
diff --git a/Makefile b/Makefile
index cce5a6e..000bf1f 100644
--- a/Makefile
+++ b/Makefile
@@ -165,6 +165,11 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
 CFLAGS = -g -O2 -Wall
+ifeq ($(uname_S),SCO_SV)
+	ifeq ($(uname_R),3.2)
+		CFLAGS = -O2
+	endif
+endif
 LDFLAGS =
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
@@ -564,6 +569,42 @@ endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	NO_STRLCPY = YesPlease
 endif
+ifeq ($(uname_S),UnixWare)
+	CC=cc
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/local/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	BASIC_CFLAGS +=  -Kalloca -Kthread
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	INSTALL = ginstall
+	TAR = gtar
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+endif
+ifeq ($(uname_S),SCO_SV)
+	NEEDS_SOCKET = YesPlease
+	NEEDS_NSL = YesPlease
+	NEEDS_SSL_WITH_CRYPTO = YesPlease
+	NEEDS_LIBICONV = YesPlease
+	SHELL_PATH = /usr/bin/bash
+	NO_IPV6 = YesPlease
+	NO_HSTRERROR = YesPlease
+	ifeq ($(uname_R),5)
+		CC=cc
+		BASIC_CFLAGS +=  -Kalloca -Kthread
+	endif
+	BASIC_CFLAGS += -I/usr/local/include
+	BASIC_LDFLAGS += -L/usr/local/lib
+	NO_STRCASESTR = YesPlease
+	NO_MEMMEM = YesPlease
+	INSTALL = ginstall
+	TAR = gtar
+endif
 ifeq ($(uname_S),Darwin)
 	NEEDS_SSL_WITH_CRYPTO = YesPlease
 	NEEDS_LIBICONV = YesPlease
diff --git a/git-compat-util.h b/git-compat-util.h
index 01c4045..b3cd7b3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -39,7 +39,12 @@
 /* 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__)
+/* Added for __USLC__ for any Novell devrived Compiler and Some Sys V 
+   Added _M_UNIX for any XENIX/SCO UNIX/OpenServer less than or equal
+   OpenServer 5.0.7  This is do avoided compiler hell like the other
+   OS's __APPLE__ and __FreeBSD__ */
+#if !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !de
+fined(_M_UNIX)
 #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
diff --git a/progress.c b/progress.c
index d19f80c..55a8687 100644
--- a/progress.c
+++ b/progress.c
@@ -241,16 +241,21 @@ void stop_progress_msg(struct progress **p_progress, const char *msg)
 	*p_progress = NULL;
 	if (progress->last_value != -1) {
 		/* Force the last update */
-		char buf[strlen(msg) + 5];
+		char buf[128], *bufp;
+		size_t len = strlen(msg) + 5;
 		struct throughput *tp = progress->throughput;
+
+		bufp = (len < sizeof(buf)) ? buf : xmalloc(len + 1);
 		if (tp) {
 			unsigned int rate = !tp->avg_misecs ? 0 :
 					tp->avg_bytes / tp->avg_misecs;
 			throughput_string(tp, tp->curr_total, rate);
 		}
 		progress_update = 1;
-		sprintf(buf, ", %s.\n", msg);
-		display(progress, progress->last_value, buf);
+		sprintf(bufp, ", %s.\n", msg);
+		display(progress, progress->last_value, bufp);
+		if (buf != bufp)
+			free(bufp);
 	}
 	clear_progress_signal();
 	free(progress->throughput);

--
Boyd Gerber [off-list ref]
ZENEZ	1042 East Fort Union #135, Midvale Utah  84047
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help