DBG("Relayd rotated stream id %" PRIu64 " successfully", stream_id);
+error:
+ return ret;
+}
+
+int relayd_rotate_rename(struct lttcomm_relayd_sock *rsock,
+ const char *current_path, const char *new_path)
+{
+ int ret;
+ struct lttcomm_relayd_rotate_rename msg;
+ struct lttcomm_relayd_generic_reply reply;
+
+ /* Code flow error. Safety net. */
+ assert(rsock);
+
+ DBG("Relayd rename chunk %s to %s", current_path, new_path);
+
+ memset(&msg, 0, sizeof(msg));
+ if (lttng_strncpy(msg.current_path, current_path,
+ sizeof(msg.current_path))) {
+ ret = -1;
+ goto error;
+ }
+ if (lttng_strncpy(msg.new_path, new_path,
+ sizeof(msg.new_path))) {
+ ret = -1;
+ goto error;
+ }
+
+ /* Send command */
+ ret = send_command(rsock, RELAYD_ROTATE_RENAME, (void *) &msg, sizeof(msg), 0);
+ if (ret < 0) {
+ goto error;
+ }
+
+ /* Receive response */
+ ret = recv_reply(rsock, (void *) &reply, sizeof(reply));
+ if (ret < 0) {
+ goto error;
+ }
+
+ reply.ret_code = be32toh(reply.ret_code);
+
+ /* Return session id or negative ret code. */
+ if (reply.ret_code != LTTNG_OK) {
+ ret = -1;
+ ERR("Relayd rotate rename replied error %d", reply.ret_code);
+ } else {
+ /* Success */
+ ret = 0;
+ }
+
+ DBG("Relayd rotate rename completed successfully");
+
error:
return ret;