summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorCharles Bailey <cbailey32@bloomberg.net>2015-07-17 17:09:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-07-17 21:39:59 (GMT)
commit100e433741715968b815e4b9fb3e638b625bf472 (patch)
treeb554bb0f63ab83472ea770d80044c62d67be902f /dir.c
parent1e8fef609e78110e276df633c5ba1fb1f1589fa5 (diff)
downloadgit-100e433741715968b815e4b9fb3e638b625bf472.zip
git-100e433741715968b815e4b9fb3e638b625bf472.tar.gz
git-100e433741715968b815e4b9fb3e638b625bf472.tar.bz2
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>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index e9eaf97..8d15e47 100644
--- a/dir.c
+++ b/dir.c
@@ -1801,7 +1801,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);