Menno Lageman wrote:
> Glynn Foster wrote:
>> Hey,
>>
>> James Litchfield wrote:
>>> Fired up prstat the other day and noticed something new: gam_server was
>>> running around madly stating files. This seems to be
>>>
>>> http://www.gnome.org/~veillard/gamin/
>>>
>>> The obvious question is why not use the Solaris file monitoring
>>> capabilities instead of stating the world away....
>> Gamin is currently built with a patch that should enable Solaris' FEM -
>>
>> http://src.opensolaris.org/source/xref/jds/spec-files/trunk/patches/gamin-01-all.diff
>>
>> hopefully others on the list will be able to say why it's behaving this way.
>>
> 
> Hmmm,
> 
> is this a finished patch? A cursory look turns up this:

It also seems to have a useless malloc that results in a memory leak:

     103 +#elif defined(HAVE_GETPEERUCRED)
     104 +        if ((creds = (ucred_t *)malloc(ucred_size()))==(ucred_t 
*)NULL){
     105 +            GAM_DEBUG(DEBUG_INFO,"Malloc failed for ucreds");
     106 +            goto failed;
     107 +        }
     108 +
     109 +        if (getpeerucred(fd, &creds)!=0){
     110 +            GAM_DEBUG(DEBUG_INFO,"getpeerucred call failed");
     111 +            goto failed;
     112 +        }

getpeerucred allocates and returns the ucred structure - you don't need
to preallocate it.

-- 
     -Alan Coopersmith-           alan.coopersmith at sun.com
      Sun Microsystems, Inc. - X Window System Engineering

Reply via email to