2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2 only,
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include <common/error.h>
26 #include "lttng-sessiond.h"
28 int ht_cleanup_pipe
[2] = { -1, -1 };
31 * Write to writable pipe used to notify a thread.
33 int notify_thread_pipe(int wpipe
)
37 /* Ignore if the pipe is invalid. */
43 ret
= write(wpipe
, "!", 1);
44 } while (ret
< 0 && errno
== EINTR
);
46 PERROR("write poll pipe");
53 * Return pointer to home directory path using the env variable HOME.
55 * No home, NULL is returned.
57 const char *get_home_dir(void)
59 return ((const char *) getenv("HOME"));
62 void ht_cleanup_push(struct lttng_ht
*ht
)
65 int fd
= ht_cleanup_pipe
[1];
70 ret
= write(fd
, &ht
, sizeof(ht
));
71 } while (ret
< 0 && errno
== EINTR
);
72 if (ret
< 0 || ret
!= sizeof(ht
)) {
73 PERROR("write ht cleanup pipe %d", fd
);
80 /* All good. Don't send back the write positive ret value. */
This page took 0.030699 seconds and 4 git commands to generate.