projects
/
deliverable
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: honor send timeout on unix socket connect
[deliverable/lttng-ust.git]
/
liblttng-ust-comm
/
lttng-ust-comm.c
diff --git
a/liblttng-ust-comm/lttng-ust-comm.c
b/liblttng-ust-comm/lttng-ust-comm.c
index 129ad8f259aaa3eea7fea766a567c207fd98797e..c01eb9dec37cc3d76b3dc32308c87519f401753c 100644
(file)
--- 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.
*/
*
* 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;
{
struct sockaddr_un sun;
int fd, ret;
@@
-110,6
+110,15
@@
int ustcomm_connect_unix_sock(const char *pathname)
ret = -errno;
goto error;
}
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");
ret = fcntl(fd, F_SETFD, FD_CLOEXEC);
if (ret < 0) {
PERROR("fcntl");
This page took
0.024775 seconds
and
5
git commands to generate.