| 59 | const char *infn = "stdin"; |
| 60 | |
| 61 | static int get_fd_data(int fd, bufferlist &bl) |
| 62 | { |
| 63 | |
| 64 | uint64_t total = 0; |
| 65 | do { |
| 66 | ssize_t bytes = bl.read_fd(fd, 1024*1024); |
| 67 | if (bytes < 0) { |
| 68 | cerr << "read_fd error " << cpp_strerror(-bytes) << "\n"; |
| 69 | return -1; |
| 70 | } |
| 71 | |
| 72 | if (bytes == 0) |
| 73 | break; |
| 74 | |
| 75 | total += bytes; |
| 76 | } while(true); |
| 77 | |
| 78 | ceph_assert(bl.length() == total); |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | //////////////////////////////////////////////////////////////////////////// |
| 83 |
no test coverage detected