Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Alexander Gordeev
В Mon, 19 Sep 2011 00:27:35 +0300 Roman Yeryomin пишет: > On 19 September 2011 00:25, Alexander Gordeev wrote: > > В Mon, 19 Sep 2011 00:22:01 +0300 > > Roman Yeryomin пишет: > > > >> >> I'll test your patch. > >> > > >> > Yes, please. > >> > >> maybe your solution is better but reading from te

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Roman Yeryomin
On 19 September 2011 00:25, Alexander Gordeev wrote: > В Mon, 19 Sep 2011 00:22:01 +0300 > Roman Yeryomin пишет: > >> >> I'll test your patch. >> > >> > Yes, please. >> >> maybe your solution is better but reading from temp file also works >> (didn't have any failure in 10k reads) > > So, does my

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Alexander Gordeev
В Mon, 19 Sep 2011 00:22:01 +0300 Roman Yeryomin пишет: > >> I'll test your patch. > > > > Yes, please. > > maybe your solution is better but reading from temp file also works > (didn't have any failure in 10k reads) So, does my patch fix the problem? -- Alexander signature.asc Descriptio

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Roman Yeryomin
On 18 September 2011 21:58, Alexander Gordeev wrote: >> >> > Well, then this is probably a bug in dd? Or uClibc? Or kernel? >> >> > Ok, I'll try to reproduce it. Can you please tell me what exactly is >> >> > happening? >> >> > >> >> >> >> Two different reads: >> >> root@OpenWrt:/# dd bs=1 skip=26

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Roman Yeryomin
On 18 September 2011 23:00, Gert Doering wrote: > Hi, > > On Sun, Sep 18, 2011 at 09:30:09PM +0300, Roman Yeryomin wrote: >> I think how it can be that you can't read 6 bytes from stdin in one >> attempt but can do it from file? > > pipe semantics are different from file semantics. > > A pipe read

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Alexander Gordeev
В Sun, 18 Sep 2011 22:02:51 +0200 Gert Doering пишет: > Hi, > > On Sun, Sep 18, 2011 at 10:58:23PM +0400, Alexander Gordeev wrote: > > BTW you shouldn't even expect to read() 6 bytes from file at once. > > For normal files, read() will never read less than requested, unless you > hit an error o

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Gert Doering
Hi, On Sun, Sep 18, 2011 at 10:58:23PM +0400, Alexander Gordeev wrote: > BTW you shouldn't even expect to read() 6 bytes from file at once. For normal files, read() will never read less than requested, unless you hit an error or eof. > $ strace -f -e trace=read,write sh -c 'dd if=/dev/urandom bs

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Gert Doering
Hi, On Sun, Sep 18, 2011 at 09:30:09PM +0300, Roman Yeryomin wrote: > I think how it can be that you can't read 6 bytes from stdin in one > attempt but can do it from file? pipe semantics are different from file semantics. A pipe read will return as soon as "everything that has been written so f

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Alexander Gordeev
В Sun, 18 Sep 2011 21:30:09 +0300 Roman Yeryomin пишет: > On 18 September 2011 20:51, Alexander Gordeev wrote: > > В Fri, 16 Sep 2011 18:06:15 +0300 > > Roman Yeryomin пишет: > > > >> On 16 September 2011 17:51, Alexander Gordeev > >> wrote: > >> > В Fri, 16 Sep 2011 17:41:37 +0300 > >> > Rom

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Roman Yeryomin
On 18 September 2011 20:51, Alexander Gordeev wrote: > В Fri, 16 Sep 2011 18:06:15 +0300 > Roman Yeryomin пишет: > >> On 16 September 2011 17:51, Alexander Gordeev wrote: >> > В Fri, 16 Sep 2011 17:41:37 +0300 >> > Roman Yeryomin пишет: >> > >> >> On 16 September 2011 01:40, Alexander Gordeev

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-18 Thread Alexander Gordeev
В Fri, 16 Sep 2011 18:06:15 +0300 Roman Yeryomin пишет: > On 16 September 2011 17:51, Alexander Gordeev wrote: > > В Fri, 16 Sep 2011 17:41:37 +0300 > > Roman Yeryomin пишет: > > > >> On 16 September 2011 01:40, Alexander Gordeev > >> wrote: > >> > В Fri, 26 Aug 2011 04:30:43 +0300 > >> > Rom

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-16 Thread Roman Yeryomin
On 16 September 2011 17:51, Alexander Gordeev wrote: > В Fri, 16 Sep 2011 17:41:37 +0300 > Roman Yeryomin пишет: > >> On 16 September 2011 01:40, Alexander Gordeev wrote: >> > В Fri, 26 Aug 2011 04:30:43 +0300 >> > Roman Yeryomin пишет: >> > >> >> This method is much more stable than reading dd

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-16 Thread Florian Fainelli
On Friday 16 September 2011 16:51:16 Alexander Gordeev wrote: > В Fri, 16 Sep 2011 17:41:37 +0300 > > Roman Yeryomin пишет: > > On 16 September 2011 01:40, Alexander Gordeev wrote: > > > В Fri, 26 Aug 2011 04:30:43 +0300 > > > > > > Roman Yeryomin пишет: > > >> This method is much more stable

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-16 Thread Alexander Gordeev
В Fri, 16 Sep 2011 17:41:37 +0300 Roman Yeryomin пишет: > On 16 September 2011 01:40, Alexander Gordeev wrote: > > В Fri, 26 Aug 2011 04:30:43 +0300 > > Roman Yeryomin пишет: > > > >> This method is much more stable than reading dd's output via stdin. > > > > What kind of problems do you have w

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-16 Thread Roman Yeryomin
On 16 September 2011 01:40, Alexander Gordeev wrote: > В Fri, 26 Aug 2011 04:30:43 +0300 > Roman Yeryomin пишет: > >> This method is much more stable than reading dd's output via stdin. > > What kind of problems do you have with piping dd's output to stdin? > It outputs garbage very frequently a

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-15 Thread Alexander Gordeev
В Fri, 26 Aug 2011 04:30:43 +0300 Roman Yeryomin пишет: > This method is much more stable than reading dd's output via stdin. What kind of problems do you have with piping dd's output to stdin? -- Alexander signature.asc Description: PGP signature __

Re: [OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-09-12 Thread Roman Yeryomin
On 26 August 2011 04:30, Roman Yeryomin wrote: > This method is much more stable than reading dd's output via stdin. > > Signed-off-by: Roman Yeryomin > > Index: package/maccalc/src/main.c > === > --- a/package/maccalc/src/main.c    

[OpenWrt-Devel] [PATCH] maccalc: add option to read mac from temp file

2011-08-25 Thread Roman Yeryomin
This method is much more stable than reading dd's output via stdin. Signed-off-by: Roman Yeryomin Index: package/maccalc/src/main.c === --- a/package/maccalc/src/main.c(revision 28007) +++ b/package/maccalc/src/main.c