diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c index 25bdf74716..0c93e6d688 100644 --- a/tools/xenstore/xenstored_posix.c +++ b/tools/xenstore/xenstored_posix.c @@ -44,6 +44,8 @@ void write_pidfile(const char *pidfile) len = snprintf(buf, sizeof(buf), "%ld\n", (long)getpid()); if (write(fd, buf, len) != len) barf_perror("Writing pid file %s", pidfile); + + close(fd); } /* Stevens. */