Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: File descriptor leakage?



On Sep 29, 11:53am, lilydjwg wrote:
}
} I discover that my zsh keeps a file descriptor to a deleted
} ".histfile.new" file:

This is the file created when the HIST_SAVE_BY_COPY option is set, which
is then renamed to the name given by $HISTFILE after being written.  I
don't know of any reason the behavior for this would have changed from
5.0.5 to 5.0.6, but it's possible that workers/33116 is related.

There is an assumption that

  fd = open(file, O_WRONLY, 0600);
  out = fdopen(fd, "w");
  fclose(out);

will close fd, but that assumption has been there for as long as the
HIST_SAVE_BY_COPY option has existed.



Messages sorted by: Reverse Date, Date, Thread, Author