• Alessandro Rubini's avatar
    wrs-socket: simplify the code retrieving timestamps · 9250cea8
    Alessandro Rubini authored
    This turns the while(1) with internal retry++ to a loop based on retry.
    With two changes:
    
    1- when recvmsg() gets EAGAIN (or other errors), we loop over instead
    of returning. Maybe this doesn't happen anymore thanks to the change
    from POLLIN to POLLERR (previous commit), but this is philosophically
    correct anyways.
    
    2- we don't print anything when poll() returns 0, as these messages
    were redundant, especially when there were many in a row. And if
    nothing is there we expect to get 0. So we removed these:
    
       poll_tx_timestamp: poll() = 0 (Success)
    
    Still, knowing the timestamp was late is useful, but a single message
    suffices, and it's there now.  If you wonder why we loop instead of
    using a longer timeout, the reason is we must get rid of timestamps
    for older frames (the ones that timeout at the previous iteration).
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    9250cea8
Name
Last commit
Last update
arch-bare-i386 Loading commit data...
arch-bare-x86-64 Loading commit data...
arch-sim Loading commit data...
arch-unix Loading commit data...
arch-wrpc Loading commit data...
arch-wrs Loading commit data...
configs Loading commit data...
doc Loading commit data...
etc Loading commit data...
include/ppsi Loading commit data...
lib Loading commit data...
lib-bare Loading commit data...
pp_printf Loading commit data...
proto-ext-whiterabbit Loading commit data...
proto-standard Loading commit data...
scripts Loading commit data...
time-bare Loading commit data...
time-sim Loading commit data...
time-unix Loading commit data...
time-wrpc Loading commit data...
time-wrs Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.LIB Loading commit data...
Kconfig Loading commit data...
MAKEALL Loading commit data...
Makefile Loading commit data...
Makefile.kconfig Loading commit data...
diag.c Loading commit data...
fsm.c Loading commit data...