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

Re: latest from CVS segfaults when FD ulimit is set too low



On Sep 22, 10:00am, Peter Stephenson wrote:
} Subject: Re: latest from CVS segfaults when FD ulimit is set too low
}
} I don't think it's safe to leave the unmoved fd open, after all,
} in too many places that will leak. In some places we need the
} original fd, but in those places if the move fails the code will
} fail catastrophically---for example in zle and completion we attempt
} to move fd 0 temporarily and then move it back; if that failed we
} shouldn't attempt the operation. I haven't done that much surgery, so
} I've restored the original zclose() here for now.

Perhaps instead of an unconditional close, movefd() should do

	if (fe != -1 || fd > 2)
	    zclose(fd);

so we never actually lose stdin/out/err but other leaks are plugged.

I haven't studied the ramifications of this.



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