Re: [PATCH v2] Fix detection of uname failure
Hi Junio, On 2015-07-17 23:39, Junio C Hamano wrote: > Johannes Schindelin writes: > >> On 2015-07-17 19:09, Charles Bailey wrote: >>> From: Charles Bailey >>> >>> According to POSIX specification uname must return -1 on failure and a >>> non-negative value on success. Although many implementations do return 0 >>> on success it is valid to return any positive value for success. In >>> particular, Solaris returns 1. >>> >>> Signed-off-by: Charles Bailey >> >> Acked-by: Johannes Schindelin > > I'd s/Ack/Review/; as the original is not your code but you are well > qualified (and have my trust) to judge the change to this codepath > ;-) Yeah, that's what I meant ;-) Ciao, Dscho -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] Fix detection of uname failure
Johannes Schindelin writes: > On 2015-07-17 19:09, Charles Bailey wrote: >> From: Charles Bailey >> >> According to POSIX specification uname must return -1 on failure and a >> non-negative value on success. Although many implementations do return 0 >> on success it is valid to return any positive value for success. In >> particular, Solaris returns 1. >> >> Signed-off-by: Charles Bailey > > Acked-by: Johannes Schindelin I'd s/Ack/Review/; as the original is not your code but you are well qualified (and have my trust) to judge the change to this codepath ;-) Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] Fix detection of uname failure
On 2015-07-17 19:09, Charles Bailey wrote: > From: Charles Bailey > > According to POSIX specification uname must return -1 on failure and a > non-negative value on success. Although many implementations do return 0 > on success it is valid to return any positive value for success. In > particular, Solaris returns 1. > > Signed-off-by: Charles Bailey Acked-by: Johannes Schindelin -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] Fix detection of uname failure
From: Charles Bailey According to POSIX specification uname must return -1 on failure and a non-negative value on success. Although many implementations do return 0 on success it is valid to return any positive value for success. In particular, Solaris returns 1. Signed-off-by: Charles Bailey --- dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dir.c b/dir.c index 8209f8b..1d42811 100644 --- a/dir.c +++ b/dir.c @@ -1848,7 +1848,7 @@ static const char *get_ident_string(void) if (sb.len) return sb.buf; - if (uname(&uts)) + if (uname(&uts) < 0) die_errno(_("failed to get kernel name and information")); strbuf_addf(&sb, "Location %s, system %s %s %s", get_git_work_tree(), uts.sysname, uts.release, uts.version); -- 2.4.0.53.g8440f74 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html