From: nicm Date: Fri, 5 Jun 2015 18:06:30 +0000 (+0000) Subject: Change deref to the more sensible unref, and add a couple I missed before. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9236dde83ee22fe1e166f9dceff444d361cef051;p=openbsd Change deref to the more sensible unref, and add a couple I missed before. --- diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c index f32071ea4da..442c65a28fb 100644 --- a/usr.bin/tmux/cfg.c +++ b/usr.bin/tmux/cfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfg.c,v 1.38 2015/05/07 11:42:56 nicm Exp $ */ +/* $OpenBSD: cfg.c,v 1.39 2015/06/05 18:06:30 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -108,7 +108,7 @@ cfg_default_done(unused struct cmd_q *cmdq) */ if (!TAILQ_EMPTY(&cfg_client->cmdq->queue)) cmdq_continue(cfg_client->cmdq); - cfg_client->references--; + server_client_unref(cfg_client); cfg_client = NULL; } } diff --git a/usr.bin/tmux/cmd-confirm-before.c b/usr.bin/tmux/cmd-confirm-before.c index 5d29087b3ae..15efc966bdf 100644 --- a/usr.bin/tmux/cmd-confirm-before.c +++ b/usr.bin/tmux/cmd-confirm-before.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-confirm-before.c,v 1.24 2015/06/05 18:01:12 nicm Exp $ */ +/* $OpenBSD: cmd-confirm-before.c,v 1.25 2015/06/05 18:06:30 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -117,7 +117,7 @@ cmd_confirm_before_free(void *data) struct cmd_confirm_before_data *cdata = data; struct client *c = cdata->client; - server_client_deref(c); + server_client_unref(c); free(cdata->cmd); free(cdata); diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c index da0846cac17..f8b56c4a4e0 100644 --- a/usr.bin/tmux/cmd-load-buffer.c +++ b/usr.bin/tmux/cmd-load-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-load-buffer.c,v 1.33 2015/06/05 18:01:12 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.34 2015/06/05 18:06:30 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -132,7 +132,7 @@ cmd_load_buffer_callback(struct client *c, int closed, void *data) return; c->stdin_callback = NULL; - server_client_deref(c); + server_client_unref(c); if (c->flags & CLIENT_DEAD) return; diff --git a/usr.bin/tmux/notify.c b/usr.bin/tmux/notify.c index 03fe7b227c3..16621954f70 100644 --- a/usr.bin/tmux/notify.c +++ b/usr.bin/tmux/notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notify.c,v 1.6 2015/04/24 23:17:11 nicm Exp $ */ +/* $OpenBSD: notify.c,v 1.7 2015/06/05 18:06:30 nicm Exp $ */ /* * Copyright (c) 2012 George Nachman @@ -121,7 +121,7 @@ notify_drain(void) } if (ne->client != NULL) - ne->client->references--; + server_client_unref(ne->client); if (ne->session != NULL) ne->session->references--; if (ne->window != NULL) diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index c9232bd65a4..b1e136fdce3 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.141 2015/06/05 18:01:12 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.142 2015/06/05 18:06:30 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -222,7 +222,7 @@ server_client_lost(struct client *c) if (event_initialized(&c->event)) event_del(&c->event); - server_client_deref(c); + server_client_unref(c); server_add_accept(0); /* may be more file descriptors now */ @@ -233,9 +233,9 @@ server_client_lost(struct client *c) /* Remove reference from a client. */ void -server_client_deref(struct client *c) +server_client_unref(struct client *c) { - log_debug("deref client %d (%d references)", c->ibuf.fd, c->references); + log_debug("unref client %d (%d references)", c->ibuf.fd, c->references); c->references--; if (c->references == 0) diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 148c2dd8a58..86879dcd389 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.518 2015/06/05 18:01:12 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.519 2015/06/05 18:06:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1871,7 +1871,7 @@ int server_client_check_nested(struct client *); void server_client_handle_key(struct client *, int); void server_client_create(int); int server_client_open(struct client *, char **); -void server_client_deref(struct client *); +void server_client_unref(struct client *); void server_client_lost(struct client *); void server_client_callback(int, short, void *); void server_client_status_timer(void);