Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string msg;
- ssize_t n;
- char buf[MAXLINE + 1];
- do {
- n = read(t, buf, MAXLINE);
- if (n < 0 && errno == EINTR) {
- continue;
- } else if (n < 0) {
- // ERROR
- return -1;
- }
- buf[n] = 0;
- msg.append(buf);
- } while (n != 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement