[#444] io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...>

I am encountering a problem similar to the one mentioned here,

19 messages 2002/09/06
[#453] Re: io_write()/fwrite() and EINTR on Solaris — nobu.nokada@... 2002/09/08

Hi,

[#454] Re: io_write()/fwrite() and EINTR on Solaris — matz@... (Yukihiro Matsumoto) 2002/09/09

Hi

[#469] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/09

On Mon, Sep 09, 2002 at 03:55:13PM +0900, Yukihiro Matsumoto wrote:

[#479] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/10

On Tue, Sep 10, 2002 at 01:04:10AM +0900, Jos Backus wrote:

[#492] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/21

On Wed, Sep 11, 2002 at 02:23:33AM +0900, Jos Backus wrote:

Re: [MemLeak] in dln.c

From: Michal Rokos <m.rokos@...>
Date: 2002-09-02 11:49:14 UTC
List: ruby-core #403
Hello,

On Sat, Aug 31, 2002 at 09:01:00AM +0900, nobu.nokada@softhome.net wrote:
> Hi,
> 
> At Fri, 30 Aug 2002 23:38:27 +0900,
> Michal Rokos wrote:
> >      if ((init_fct = (void(*)())GetProcAddress(handle, buf)) == NULL) {
> > -	rb_loaderror("%s - %s\n%s", dln_strerror(), buf, file);
> > +	rb_loaderror("%s - %s\n%s", dln_strerror(), buf, file); /* FIXME: MEMLEAK for buf */
> >      }
> >      free(buf);
> 
> This looks tiresome.
> 
> Which do you prefer?
> 

	Well, personally, I'd add (before line with /* FIXME: Mem
	leak... */ this:

> >      if ((init_fct = (void(*)())GetProcAddress(handle, buf)) == NULL) {
	Data_Wrap_Struct(rb_cData, 0, free, buf);
> > +	rb_loaderror("%s - %s\n%s", dln_strerror(), buf, file); /* FIXME: MEMLEAK for buf */
> >      }
> >      free(buf);

	(and on the 2nd place as well.)

	I know, that it has a flaw in it, but it could be OK.

> (3) make init_funcname() to return VALUE and caller to hold it,
>     and remove all free(buf) lines.

	I used part of your #3, thanks.

	Any ideas?

		Michal

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos@sh.cvut.cz      ICQ:36118339      Jabber:majkl@jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In This Thread