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
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
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
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
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
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.
@@ -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.
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.
@@ -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 */-charbuf[strlen(msg)+5];+/* char buf[strlen(msg) + 5]; */+char*buf=alloca(strlen(msg)+5);structthroughput*tp=progress->throughput;if(tp){unsignedintrate=!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(-)
@@ -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 */-charbuf[strlen(msg)+5];+/* char buf[strlen(msg) + 5]; */+char*buf=alloca(strlen(msg)+5);structthroughput*tp=progress->throughput;if(tp){unsignedintrate=!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(-)
@@ -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 */-charbuf[strlen(msg)+5];+charbuf[128],*bufp;+size_tlen=strlen(msg)+5;structthroughput*tp=progress->throughput;++bufp=(len<sizeof(buf))?buf:xmalloc(len+1);if(tp){unsignedintrate=!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
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
@@ -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+endifLDFLAGS=ALL_CFLAGS=$(CFLAGS)ALL_LDFLAGS=$(LDFLAGS)
@@ -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_UNIXforanyXENIX/SCOUNIX/OpenServerlessthanorequal+OpenServer5.0.7Thisisdoavoidedcompilerhellliketheother+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
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
@@ -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*
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
@@ -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+endifLDFLAGS=ALL_CFLAGS=$(CFLAGS)ALL_LDFLAGS=$(LDFLAGS)
@@ -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_UNIXforanyXENIX/SCOUNIX/OpenServerlessthanorequal+OpenServer5.0.7Thisisdoavoidedcompilerhellliketheother+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