root/tags/omega-1.0.0-rc2/tools/daemon/send_data.c
| Revision 154, 379 bytes (checked in by malte, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | |
| 2 | #include "send_data.h" |
| 3 | |
| 4 | int send_data(int fd, char *src, size_t n) |
| 5 | { |
| 6 | char *p; |
| 7 | |
| 8 | ssize_t res; |
| 9 | |
| 10 | size_t i = 0; |
| 11 | |
| 12 | p = src; |
| 13 | |
| 14 | while (i < n) { |
| 15 | |
| 16 | if ( ( res = write(fd, p, 1) ) <= 0 ) { |
| 17 | if (res != EINTR) { |
| 18 | return (-1); |
| 19 | } else { |
| 20 | say("%s", message(MSG_ERROR_EINTR)); |
| 21 | } |
| 22 | } else { |
| 23 | p++; i++; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | return (i); |
| 28 | } |
| 29 |
Note: See TracBrowser
for help on using the browser.
