From 062513757c3184c14ac5221aaeb3d437af222039 Mon Sep 17 00:00:00 2001 From: jun7 Date: Fri, 8 Jun 2018 23:29:53 +0900 Subject: [PATCH] Change pid --- wyebrun.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wyebrun.c b/wyebrun.c index bab2872..6102c93 100644 --- a/wyebrun.c +++ b/wyebrun.c @@ -17,9 +17,9 @@ You should have received a copy of the GNU General Public License along with wyebrun. If not, see . */ - -//gettid -#include +//getpid +#include +#include //flock #include @@ -275,7 +275,8 @@ static Client *makecli() { Client *cli = g_new0(Client, 1); g_mutex_init(&cli->retm); - cli->pid = g_strdup_printf("%d", (pid_t)syscall(SYS_gettid)); + static int tid = 0; + cli->pid = g_strdup_printf("%d-%u", tid++, getpid()); cli->wctx = g_main_context_new(); cli->loop = g_main_loop_new(cli->wctx, true);