projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cygwin: Pass file paths instead of file descriptors over UNIX sockets
[lttng-ust.git]
/
liblttng-ust
/
lttng-ust-comm.c
diff --git
a/liblttng-ust/lttng-ust-comm.c
b/liblttng-ust/lttng-ust-comm.c
index dece0ee6e70d42ef4982e545884a6f944e550fc8..3bddf76744216c4d684e940290f0089e67c13c43 100644
(file)
--- a/
liblttng-ust/lttng-ust-comm.c
+++ b/
liblttng-ust/lttng-ust-comm.c
@@
-22,7
+22,6
@@
#define _LGPL_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#define _LGPL_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
-#include <sys/prctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
@@
-46,6
+45,7
@@
#include <usterr-signal-safe.h>
#include "tracepoint-internal.h"
#include "ltt-tracer-core.h"
#include <usterr-signal-safe.h>
#include "tracepoint-internal.h"
#include "ltt-tracer-core.h"
+#include "compat.h"
#include "../libringbuffer/tlsfixup.h"
/*
#include "../libringbuffer/tlsfixup.h"
/*
@@
-177,7
+177,6
@@
static
int register_app_to_sessiond(int socket)
{
ssize_t ret;
int register_app_to_sessiond(int socket)
{
ssize_t ret;
- int prctl_ret;
struct {
uint32_t major;
uint32_t minor;
struct {
uint32_t major;
uint32_t minor;
@@
-196,11
+195,7
@@
int register_app_to_sessiond(int socket)
reg_msg.uid = getuid();
reg_msg.gid = getgid();
reg_msg.bits_per_long = CAA_BITS_PER_LONG;
reg_msg.uid = getuid();
reg_msg.gid = getgid();
reg_msg.bits_per_long = CAA_BITS_PER_LONG;
- prctl_ret = prctl(PR_GET_NAME, (unsigned long) reg_msg.name, 0, 0, 0);
- if (prctl_ret) {
- ERR("Error executing prctl");
- return -errno;
- }
+ lttng_ust_getprocname(reg_msg.name);
ret = ustcomm_send_unix_sock(socket, ®_msg, sizeof(reg_msg));
if (ret >= 0 && ret != sizeof(reg_msg))
ret = ustcomm_send_unix_sock(socket, ®_msg, sizeof(reg_msg));
if (ret >= 0 && ret != sizeof(reg_msg))
@@
-257,6
+252,7
@@
int handle_message(struct sock_info *sock_info,
const struct lttng_ust_objd_ops *ops;
struct ustcomm_ust_reply lur;
int shm_fd, wait_fd;
const struct lttng_ust_objd_ops *ops;
struct ustcomm_ust_reply lur;
int shm_fd, wait_fd;
+ char *shm_path, *wait_pipe_path;
union ust_args args;
ust_lock();
union ust_args args;
ust_lock();
@@
-315,14
+311,18
@@
end:
* Use lum.u output.
*/
lur.u.stream.memory_map_size = *args.stream.memory_map_size;
* Use lum.u output.
*/
lur.u.stream.memory_map_size = *args.stream.memory_map_size;
- shm_fd = *args.stream.shm_fd;
- wait_fd = *args.stream.wait_fd;
+ shm_fd = *args.stream.shm_fd;
+ shm_path = args.stream.shm_path;
+ wait_fd = *args.stream.wait_fd;
+ wait_pipe_path = args.stream.wait_pipe_path;
break;
case LTTNG_UST_METADATA:
case LTTNG_UST_CHANNEL:
lur.u.channel.memory_map_size = *args.channel.memory_map_size;
break;
case LTTNG_UST_METADATA:
case LTTNG_UST_CHANNEL:
lur.u.channel.memory_map_size = *args.channel.memory_map_size;
- shm_fd = *args.channel.shm_fd;
- wait_fd = *args.channel.wait_fd;
+ shm_fd = *args.channel.shm_fd;
+ shm_path = args.channel.shm_path;
+ wait_fd = *args.channel.wait_fd;
+ wait_pipe_path = args.channel.wait_pipe_path;
break;
case LTTNG_UST_TRACER_VERSION:
lur.u.version = lum->u.version;
break;
case LTTNG_UST_TRACER_VERSION:
lur.u.version = lum->u.version;
@@
-344,23
+344,19
@@
end:
&& lur.ret_code == USTCOMM_OK) {
int sendret = 0;
&& lur.ret_code == USTCOMM_OK) {
int sendret = 0;
- /* we also need to send the file descriptors. */
- ret = ustcomm_send_fds_unix_sock(sock,
- &shm_fd, &shm_fd,
- 1, sizeof(int));
+ /* send the shm path */
+ ret = ustcomm_send_string(sock, shm_path, strlen(shm_path));
if (ret < 0) {
if (ret < 0) {
- perror("send shm_
fd
");
+ perror("send shm_
path
");
sendret = ret;
}
/*
* The sessiond expects 2 file descriptors, even upon
* error.
*/
sendret = ret;
}
/*
* The sessiond expects 2 file descriptors, even upon
* error.
*/
- ret = ustcomm_send_fds_unix_sock(sock,
- &wait_fd, &wait_fd,
- 1, sizeof(int));
+ ret = ustcomm_send_string(sock, wait_pipe_path, strlen(wait_pipe_path));
if (ret < 0) {
if (ret < 0) {
- perror("send wait_
fd
");
+ perror("send wait_
pipe_path
");
goto error;
}
if (sendret) {
goto error;
}
if (sendret) {
This page took
0.024903 seconds
and
4
git commands to generate.