Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2007 10:18:12 -0700 (PDT)
From:      youshi10@u.washington.edu
To:        hackers@freebsd.org
Subject:   Re: Using shell commands versus C equivalents
Message-ID:  <Pine.LNX.4.43.0706131018120.25469@hymn01.u.washington.edu>
In-Reply-To: <20070613153555.GA4439@britannica.bec.de>

next in thread | previous in thread | raw e-mail | index | archive | help



On Wed, 13 Jun 2007, Joerg Sonnenberger wrote:

> On Wed, Jun 13, 2007 at 08:26:38AM -0700, Garrett Cooper wrote:
>> Sorry -- actually I meant that (along similar lines), there was a
>> program with the following lines:
>>
>> vsystem("/bin/chmod +x %s", filename);
>>
>> and I replaced it with:
>>
>> chmod(filename, (mode_t) ( S_IXUSR | S_IXGRP | S_IXOTH ));
>
> You supposedly mean stat + chmod here, right? Trivial errors like this
> are easy to make.

Yes ><. Good catch, thanks :).

>> Next step, eliminating the linked list structure in favor or red-black
>> trees, maybe.
>
> Due to the way pkg_install works, this most likely is just adding
> complexity for no gain, it might actually slow it down.

Hmmm... the only thing is that it does the linked list traversal a number of times per dependency. I'll take a look in gdb at the size of each dependency and then confer with Kirill (my mentor) about that a bit more.

-Garrett




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.43.0706131018120.25469>