Valgrind says: close(-1) is not nice
This commit is contained in:
parent
ea8f29f428
commit
06f8194dfb
@ -27,7 +27,7 @@
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.124 2012/05/04 20:49:04 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.125 2012/05/05 18:04:20 tg Exp $");
|
||||||
|
|
||||||
Trap sigtraps[NSIG + 1];
|
Trap sigtraps[NSIG + 1];
|
||||||
static struct sigaction Sigact_ign;
|
static struct sigaction Sigact_ign;
|
||||||
@ -941,8 +941,10 @@ writehistline(int fd, int lno, const char *cmd)
|
|||||||
void
|
void
|
||||||
hist_finish(void)
|
hist_finish(void)
|
||||||
{
|
{
|
||||||
mksh_unlkfd(histfd);
|
if (histfd >= 0) {
|
||||||
(void)close(histfd);
|
mksh_unlkfd(histfd);
|
||||||
|
(void)close(histfd);
|
||||||
|
}
|
||||||
histfd = -1;
|
histfd = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user