On Thu, Apr 28, 2011 at 03:08:37PM +0200, Marc Kleine-Budde wrote:
> On 04/28/2011 02:47 PM, Kurt Van Dijck wrote:
> >> I quickly looked over the code, see some comments inline.
> >>
> > Thanks, I have some additional questions:
> >>> ---
> >>> + /* run */
> >>> + while (1) {
> >>> +         ret = poll(pfd, 2, -1);
> >> ARRAY_SIZE?
> > is that available in userspace? cool!
> 
> ...if you define it :)
> 
ok, I'll do sizeof(x)/sizeof(x[0])
> >>> +         if (ret < 0)
> >>> +                 error(1, errno, "poll()");
> >>
> >> what about EINTR?
> >>
> > well, that's indeed a typical one, but the remainder of the program is
> > not interested in any signal...
> 
> If you attach strace to this program while waiting in poll it will exit.
> 
interesting. I'm getting smarter every day :-)
> >>> +                         break;
> >>> +                 }
> >>> +                 len = ret;
> >>> +                 for (done = 0; done < len; ) {
> >>> +                         ret = send(pfd[1].fd, buf, len, s.sendflags);
> >>> +                         if (ret < 0) {
> >>> +                                 error(0, errno, "write(%s)", 
> >>> libj1939_addr2str(&s.src));
> >>> +                                 if (ENOBUFS == errno) {
> >>
> >> the other way round?
> >>
> > ???
> 
> just nitpicking:
> 
> In the "kernel" we usually compare like this:
> 
> if ($VARIABLE == $CONSTANT)
> not ($CONSTANT == $VARIABLE)

ok I see.
> 

Thanks,
Kurt
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to