My Various Git Projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62e91ef
)
git_mkstemps: correctly test return value of open()
author
Dale R. Worley
<worley@alum.mit.edu>
Fri, 12 Jul 2013 08:58:35 +0000
(10:58 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 12 Jul 2013 17:30:08 +0000
(10:30 -0700)
open() returns -1 on failure, and indeed 0 is a possible success value
if the user closed stdin in our process. Fix the test.
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wrapper.c
patch
|
blob
|
history
diff --git
a/wrapper.c
b/wrapper.c
index
bac59d2
..
094b2ab
100644
(file)
--- a/
wrapper.c
+++ b/
wrapper.c
@@
-322,7
+322,7
@@
int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
template[5] = letters[v % num_letters]; v /= num_letters;
fd = open(pattern, O_CREAT | O_EXCL | O_RDWR, mode);
- if (fd > 0)
+ if (fd >
=
0)
return fd;
/*
* Fatal error (EPERM, ENOSPC etc).