untracked: fix detection of uname(2) failure

According to POSIX specification uname(2) 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 <cbailey32@bloomberg.net> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Charles Bailey committed Jul 17, 2015 at 18:09 UTC 100e433741715968b815e4b9fb3e638b625bf472
1 file changed +1 -1
dir.c
+1 -1
@@ -1801,7 +1801,7 @@ static const char *get_ident_string(void)
1801
1802 if (sb.len)
1803 return sb.buf;
1804 - if (uname(&uts))
1804 + if (uname(&uts) < 0)
1805 die_errno(_("failed to get kernel name and information"));
1806 strbuf_addf(&sb, "Location %s, system %s %s %s", get_git_work_tree(),
1807 uts.sysname, uts.release, uts.version);