cpu/native: do not exit when real_read returns 0#2686
cpu/native: do not exit when real_read returns 0#2686cgundogan merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
EOF on any of natives file handles is an error. |
|
Unless you can explain what EOF means on a tap device and why it isn't an error, I'd reject this PR. |
9f184dd to
45554bf
Compare
|
Well the underlying (native) The |
|
read should only be called if data is available in the first place due to the interrupt based implementation around it. It should be non-blocking due to this as well. Anyway - this interrupt/poll based program flow is why I think zero is an error to begin with. It might be some strange and harmless race condition though. I would suggest you check the tuntap implementations of Linux and BSD and find out why zero is returned. Finally, I searched other tap users quickly and I think it was virtualbox who also ignored EOF on taps, so I expect it is in fact harmless. |
|
For the record: with #2558 I do get this error as well if I run |
|
After reading the Linux implementation, I ACK ignoring the event, but not this implementation. + else if (nread == 0) {
+ DEBUG("_native_handle_tap_input: ignoring null-event");
+ } |
aa68140 to
4fae22b
Compare
|
addressed @LudwigOrtmann's comment |
|
ACK |
|
@LudwigOrtmann and Travis are happy => GO |
cpu/native: do not exit when real_read returns 0
When
real_read()returns 0 bytes, the application exits with an error. Posix states, that0indicates EOF and is not really an error case. So I propose to remove thiselse-check to not end the execution of native in such a case. See #2664