goto error;
}
+ /*
+ * Set the CLOEXEC flag. Return code is useless because either way, the
+ * show must go on.
+ */
+ (void) utils_set_fd_cloexec(sock);
+
health_code_update(&consumer_data->health);
DBG2("Receiving code from consumer err_sock");
goto error;
}
+ /*
+ * Set the CLOEXEC flag. Return code is useless because
+ * either way, the show must go on.
+ */
+ (void) utils_set_fd_cloexec(sock);
+
/* Create UST registration command for enqueuing */
ust_cmd = zmalloc(sizeof(struct ust_command));
if (ust_cmd == NULL) {
goto error;
}
+ /*
+ * Set the CLOEXEC flag. Return code is useless because either way, the
+ * show must go on.
+ */
+ (void) utils_set_fd_cloexec(sock);
+
ret = lttcomm_listen_unix_sock(sock);
if (ret < 0) {
goto error;
goto error;
}
+ /*
+ * Set the CLOEXEC flag. Return code is useless because either way, the
+ * show must go on.
+ */
+ (void) utils_set_fd_cloexec(new_sock);
+
DBG("Receiving data from client for health...");
ret = lttcomm_recv_unix_sock(new_sock, (void *)&msg, sizeof(msg));
if (ret <= 0) {
goto error;
}
+ /*
+ * Set the CLOEXEC flag. Return code is useless because either way, the
+ * show must go on.
+ */
+ (void) utils_set_fd_cloexec(sock);
+
/* Set socket option for credentials retrieval */
ret = lttcomm_setsockopt_creds_unix_sock(sock);
if (ret < 0) {
goto end;
}
+ /* Set the cloexec flag */
+ ret = utils_set_fd_cloexec(client_sock);
+ if (ret < 0) {
+ ERR("Unable to set CLOEXEC flag to the client Unix socket (fd: %d). "
+ "Continuing but note that the consumer daemon will have a "
+ "reference to this socket on exec()", client_sock);
+ }
+
/* File permission MUST be 660 */
ret = chmod(client_unix_sock_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
if (ret < 0) {
goto end;
}
+ /* Set the cloexec flag */
+ ret = utils_set_fd_cloexec(apps_sock);
+ if (ret < 0) {
+ ERR("Unable to set CLOEXEC flag to the app Unix socket (fd: %d). "
+ "Continuing but note that the consumer daemon will have a "
+ "reference to this socket on exec()", apps_sock);
+ }
+
/* File permission MUST be 666 */
ret = chmod(apps_unix_sock_path,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
goto end;
}
+ DBG3("Session daemon client socket %d and application socket %d created",
+ client_sock, apps_sock);
+
end:
umask(old_umask);
return ret;