[MPlayer-dev-eng] [PATCH] Avoid resource lockup by xscreensaver
Arpi
arpi at thot.banki.hu
Sun Sep 29 17:45:25 CEST 2002
Hi,
> > + getrlimit(RLIMIT_NOFILE, &rlim);
> > + for (i=0; i < rlim.rlim_cur; i++)
> > + (void)close(i);
> > + execlp("xscreensaver", "xscreensaver", "-no-splash", NULL);
> IMHO this patch should not be committed as-is, since some broken
> systems are missing various RLIMIT constants or missing getrlimit
agree
> entirely. (I think cygwin is one such system...) A much better
> solution is just to set the close-on-exec flag properly on each fd
> when it is opened.
agree
patch?
> Also you should never exec a program without fd 0, 1, and 2 opened to
> *something*. /dev/null is of course ok. But if you start a program
> with no fd 0-2, and then it opens a file for writing and subsequently
> tries to write error output to stderr, it can trash its own file it
> just opened. Very bad.
agree
A'rpi / Astral & ESP-team
--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
More information about the MPlayer-dev-eng
mailing list