Changeset 133 in flair-src for trunk/lib/FlairCore/src/Socket_impl.cpp
- Timestamp:
- Feb 9, 2017, 11:08:31 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Socket_impl.cpp
r93 r133 103 103 #endif 104 104 if (status != 0) { 105 self->Err("rt_pipe_create error (%s)\n", strerror(-status)); 105 char errorMsg[256]; 106 self->Err("rt_pipe_create error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg))); 106 107 } 107 108 … … 148 149 pthread_join(user_thread, NULL); 149 150 int status = rt_pipe_delete(&pipe); 150 if (status != 0) 151 self->Err("rt_pipe_delete error (%s)\n", strerror(-status)); 152 151 if (status != 0) { 152 char errorMsg[256]; 153 self->Err("rt_pipe_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg))); 154 } 153 155 #endif 154 156 close(fd); … … 158 160 ssize_t written; 159 161 string to_send; 162 char errorMsg[256]; 160 163 161 164 if (broadcast == true) { … … 170 173 171 174 if (written < 0) { 172 self->Err("rt_pipe_write error (%s)\n", strerror (-written));175 self->Err("rt_pipe_write error (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg))); 173 176 } else if (written != (ssize_t)src_len) { 174 177 self->Err("rt_pipe_write error %i/%i\n", written, to_send.size()); … … 178 181 sendto(fd, src, src_len, 0, (struct sockaddr *)&sock_in, sizeof(sock_in)); 179 182 if(written==-1) { 180 self->Err("sendto error (%s)\n",strerror(-errno)); 183 char errorMsg[256]; 184 self->Err("sendto error (%s)\n",strerror_r(errno, errorMsg, sizeof(errorMsg))); 181 185 } else if (written != (ssize_t)src_len) { 182 186 self->Err("sendto error %i/%i\n",written,src_len); … … 195 199 196 200 if (written < 0) { 197 self->Err("rt_pipe_write error (%s)\n", strerror(-written)); 201 char errorMsg[256]; 202 self->Err("rt_pipe_write error (%s)\n", strerror_r(-written, errorMsg, sizeof(errorMsg))); 198 203 } else if (written != (ssize_t)message.size()) { 199 204 self->Err("rt_pipe_write error %i/%i\n", written, message.size()); … … 295 300 while (pipe_fd < 0) { 296 301 pipe_fd = open(devname.c_str(), O_RDWR); 297 if (pipe_fd < 0 && errno != ENOENT) 298 caller->self->Err("open pipe_fd error (%s)\n", strerror(-errno)); 302 if (pipe_fd < 0 && errno != ENOENT) { 303 char errorMsg[256]; 304 caller->self->Err("open pipe_fd error (%s)\n", strerror_r(errno, errorMsg, sizeof(errorMsg))); 305 } 299 306 usleep(1000); 300 307 }
Note:
See TracChangeset
for help on using the changeset viewer.