Re: [PATCH] Free OSS device on pause

"Metathronius Galabant" <[email protected]> Fri, 13 Oct 2006 21:39:33 +0200
Newsgroups gmane.comp.multimedia.xmms.devel
Message-ID <[email protected]>
> That's pure luck, any file that is opened between the pause and the
> unpause might get the fd number that we closed when pausing. When
> unpausing that file will be closed instead of the sound device, which
> will probably cause bad things to happen. Try the small program that I
> posted earlier and see for yourself that fd numbers *will* be reused!

Okay, one last comment and then I'll just give up (only poor schmocks
like me still use good old OSS, anyway :).
Yes, that is true the the fd-number will/can be reused or change. Still

1) fd is a static in audio.c and thusly never used by any code
outside, nor is it copied to the outside
2) fd is only used *once* in a call-by-value context (write_all()) and
that's no problem there as it is a plain and simple function

and as such it is no problem if the fd gets a 3 or a 100 or is reused
or changes due the execution of xmms.
If I am missing something fundamental, please try to make it more clear to me :)

Cheers,
M