Re: [libav-devel] [PATCH 2/2] pktdumper: Use usleep instead of sleep

2012-01-25 Thread Diego Biurrun
On Wed, Jan 25, 2012 at 02:23:40PM +0200, Martin Storsjö wrote:
> On Wed, 25 Jan 2012, Diego Biurrun wrote:
> 
> >On Wed, Jan 25, 2012 at 01:17:44PM +0100, Diego Biurrun wrote:
> >>On Wed, Jan 25, 2012 at 02:05:27PM +0200, Martin Storsjö wrote:
> >>>--- a/tools/pktdumper.c
> >>>+++ b/tools/pktdumper.c
> >>>@@ -120,7 +120,7 @@ int main(int argc, char **argv)
> >>>
> >>> while (donotquit)
> >>>-sleep(60);
> >>>+usleep(60*100);
> >>
> >>Add spaces around the operator and patch OK.
> >
> >Ahem, wait, I think you added three zeros too many, usleep() sleeps
> >for microseconds, not nanoseconds.
> 
> sleep takes seconds, usleep takes microseconds, and the conversion
> factor is 10^6 == 100.

Yeah, brainfart, you are right of course and patch OK.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] pktdumper: Use usleep instead of sleep

2012-01-25 Thread Martin Storsjö

On Wed, 25 Jan 2012, Diego Biurrun wrote:


On Wed, Jan 25, 2012 at 01:17:44PM +0100, Diego Biurrun wrote:

On Wed, Jan 25, 2012 at 02:05:27PM +0200, Martin Storsjö wrote:

--- a/tools/pktdumper.c
+++ b/tools/pktdumper.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)

 while (donotquit)
-sleep(60);
+usleep(60*100);


Add spaces around the operator and patch OK.


Ahem, wait, I think you added three zeros too many, usleep() sleeps
for microseconds, not nanoseconds.


sleep takes seconds, usleep takes microseconds, and the conversion factor 
is 10^6 == 100.


// Martin___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] pktdumper: Use usleep instead of sleep

2012-01-25 Thread Diego Biurrun
On Wed, Jan 25, 2012 at 01:17:44PM +0100, Diego Biurrun wrote:
> On Wed, Jan 25, 2012 at 02:05:27PM +0200, Martin Storsjö wrote:
> > --- a/tools/pktdumper.c
> > +++ b/tools/pktdumper.c
> > @@ -120,7 +120,7 @@ int main(int argc, char **argv)
> >  
> >  while (donotquit)
> > -sleep(60);
> > +usleep(60*100);
> 
> Add spaces around the operator and patch OK.

Ahem, wait, I think you added three zeros too many, usleep() sleeps
for microseconds, not nanoseconds.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] pktdumper: Use usleep instead of sleep

2012-01-25 Thread Diego Biurrun
On Wed, Jan 25, 2012 at 02:05:27PM +0200, Martin Storsjö wrote:
> --- a/tools/pktdumper.c
> +++ b/tools/pktdumper.c
> @@ -120,7 +120,7 @@ int main(int argc, char **argv)
>  
>  while (donotquit)
> -sleep(60);
> +usleep(60*100);

Add spaces around the operator and patch OK.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel