X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust-comm%2Flttng-ust-comm.c;h=c01eb9dec37cc3d76b3dc32308c87519f401753c;hb=451d66b27efb332bd16f79dcee374b6a2c85186f;hp=ecc23821fb6fa29624dcbc25564c5011eed4aafb;hpb=a6f80644ef276de19ba7e018659070b7504d7ca4;p=lttng-ust.git diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index ecc23821..c01eb9de 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -95,7 +95,7 @@ const char *lttng_ust_strerror(int code) * * Connect to unix socket using the path name. */ -int ustcomm_connect_unix_sock(const char *pathname) +int ustcomm_connect_unix_sock(const char *pathname, long timeout) { struct sockaddr_un sun; int fd, ret; @@ -110,6 +110,15 @@ int ustcomm_connect_unix_sock(const char *pathname) ret = -errno; goto error; } + if (timeout >= 0) { + /* Give at least 10ms. */ + if (timeout < 10) + timeout = 10; + ret = ustcomm_setsockopt_snd_timeout(fd, timeout); + if (ret < 0) { + WARN("Error setting connect socket send timeout"); + } + } ret = fcntl(fd, F_SETFD, FD_CLOEXEC); if (ret < 0) { PERROR("fcntl"); @@ -766,7 +775,7 @@ ssize_t count_ctx_fields_recursive(size_t nr_fields, } static -int serialize_string_encoding(enum ustctl_string_encodings *ue, +int serialize_string_encoding(int32_t *ue, enum lttng_string_encodings le) { switch (le) { @@ -1094,6 +1103,11 @@ int serialize_entries(struct ustctl_enum_entry **_entries, uentry->end.signedness = lentry->end.signedness; strncpy(uentry->string, lentry->string, LTTNG_UST_SYM_NAME_LEN); uentry->string[LTTNG_UST_SYM_NAME_LEN - 1] = '\0'; + + if (lentry->u.extra.options & LTTNG_ENUM_ENTRY_OPTION_IS_AUTO) { + uentry->u.extra.options |= + USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO; + } } *_entries = entries; return 0;