mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
ncb: Check return value of write()
This prevents the compilation warning: ncb.c: In function 'main': ncb.c:32: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
This commit is contained in:
parent
dbe29e36a4
commit
eea8be86d1
|
@ -1,3 +1,4 @@
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@ -29,7 +30,8 @@ int main (int argc, char *argv[])
|
||||||
len = recvfrom (s, buf, sizeof buf, 0, (struct sockaddr *) &addr, &addr_len);
|
len = recvfrom (s, buf, sizeof buf, 0, (struct sockaddr *) &addr, &addr_len);
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
break;
|
break;
|
||||||
write (1, buf, len);
|
if (write (1, buf, len) != len)
|
||||||
|
fprintf(stderr, "WARNING: serial characters dropped\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user