projects
/
sxemacs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9983c00
)
Coverity fix: USE_AFTER_FREE CID:438
author
Nelson Ferreira
<nelson.ferreira@ieee.org>
Mon, 10 Oct 2011 13:51:43 +0000
(09:51 -0400)
committer
Nelson Ferreira
<nelson.ferreira@ieee.org>
Mon, 10 Oct 2011 13:51:43 +0000
(09:51 -0400)
* src/sysdep.c (sys_fclose): loop with close on fd, not fclose
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/sysdep.c
patch
|
blob
|
history
diff --git
a/src/sysdep.c
b/src/sysdep.c
index
fa74c2d
..
e4844df
100644
(file)
--- a/
src/sysdep.c
+++ b/
src/sysdep.c
@@
-2454,9
+2454,11
@@
FILE *sys_fopen(const char *path, const char *type)
int sys_fclose(FILE * stream)
{
#ifdef INTERRUPTIBLE_CLOSE
- int rtnval;
+ int fd = fileno(stream);
+ int rtnval = fclose(stream);
- while ((rtnval = fclose(stream)) == EOF && (errno == EINTR)) ;
+ if (rtnval == EOF && (errno == EINTR))
+ while (((rtnval=close(fd))<0) && (errno == EINTR));
return rtnval;
#else
return fclose(stream);