logo       


Re: Wget 1.9.1 uses usleep() incorrectly: msg#00081

Subject: Re: Wget 1.9.1 uses usleep() incorrectly
"Jesper Louis Andersen" <jlouis@xxxxxxxxxxx> writes:

>> The latest source (available in CVS) has a better sleeping function
>> that uses nanosleep where available, and that handles usleep's
>> wraparound for long sleeps.  But it still can call usleep with values
>> larger than 1,000,000.  I've attached a patch that fixes the CVS
>> source.
>
> nanosleep() returns EINVAL for values less than zero or greater than
> 1000 million. This may or may not hurt you.

That is true for the nanoseconds field.  But nanosleep allows you to
specify seconds and nanoseconds separately, which Wget does.
(nanosleep is also nicer because it allows easy recovery from sleep
being interrupted by a signal.)

>> sleep(3) cannot sleep for less than a second.  I like the idea of
>> being able to specify `--wait 0.5' for Wget to wait for half a second
>> between retrievals.
>
> This I see. A suggestion from David Laight was to use poll():
>
>       poll(0, 0, 1000L * opt.wait);

That change would work fine for NetBSD.  I don't think you need to
worry about signals being delivered to the code at that point.



Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe