As this struct has a flexible array member, a pointer fits better.
Change-Id: I6df7c1c372ea0f061bca05faf9538713c77f8a75
/* should fit a whole command line with concatenated arguments (reasonably) */
#define MAX_LOGGER_REQUEST_LEN 127
-int connect_pipe(const char *path, struct dlog_control_msg ctrl_msg, int timeout_ms);
+int connect_pipe(const char *path, struct dlog_control_msg *ctrl_msg, int timeout_ms);
#endif
const int wrlock = pthread_rwlock_wrlock(&log_pipe_lock);
assert(!wrlock); // we are never supposed to have a read lock at this point so wrlock() can't fail
- new_fd = connect_pipe(log_pipe_path[log_id], DLOG_CTRL_REQ_PIPE, wait_pipe_ms);
+ new_fd = connect_pipe(log_pipe_path[log_id], &DLOG_CTRL_REQ_PIPE, wait_pipe_ms);
if (new_fd < 0) {
/* if connnecting fails consequently assume
* dlog_logger is broken and reduce the timeout to
* @param[in] timeout_ms How long to wait for input on sockfd, forever if 0
* @return Pipe file descriptor, or negative errno on failure
*/
-int connect_pipe(const char *path, struct dlog_control_msg ctrl_msg, int timeout_ms)
+int connect_pipe(const char *path, struct dlog_control_msg *ctrl_msg, int timeout_ms)
{
int r;
int fd;
return -errno;
}
- r = write(fd, &ctrl_msg, ctrl_msg.length);
+ r = write(fd, ctrl_msg, ctrl_msg->length);
if (r < 0) {
close(fd);
return -errno;