The branch, master has been updated
via 4273c1b80e2eb321d44154fe1e82e0f11aabcbd5 (commit)
from 488583dc8def345b32dafe5b4f9bdb0a280062d3 (commit)
- Log -----------------------------------------------------------------
commit 4273c1b80e2eb321d44154fe1e82e0f11aabcbd5
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>
Use utempter to update utmp if it's around for configure, from madmaverick9
at
roxxmail dot eu.
---
configure.ac | 7 +++++++
server-fn.c | 3 +++
tmux.h | 4 ++++
window.c | 11 +++++++++++
4 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index fec7904..05286d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,13 @@ if test "x$found_curses" = xno; then
AC_MSG_ERROR("curses not found")
fi
+# Look for utempter
+AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
+if test "x$have_utempter" = xyes; then
+ AC_DEFINE(HAVE_UTEMPTER)
+ LIBS="$LIBS -lutempter"
+fi
+
# Check for b64_ntop.
AC_MSG_CHECKING(for b64_ntop)
AC_TRY_LINK(
diff --git a/server-fn.c b/server-fn.c
index a00cadb..3062698 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -361,6 +361,9 @@ server_destroy_pane(struct window_pane *wp)
old_fd = wp->fd;
if (wp->fd != -1) {
+#ifdef HAVE_UTEMPTER
+ utempter_remove_record(wp->fd);
+#endif
bufferevent_free(wp->event);
close(wp->fd);
wp->fd = -1;
diff --git a/tmux.h b/tmux.h
index 7d5f230..ec5cf55 100644
--- a/tmux.h
+++ b/tmux.h
@@ -32,6 +32,10 @@
#include <stdio.h>
#include <termios.h>
+#ifdef HAVE_UTEMPTER
+#include <utempter.h>
+#endif
+
#include "array.h"
#include "compat.h"
diff --git a/window.c b/window.c
index f41b58d..7053045 100644
--- a/window.c
+++ b/window.c
@@ -779,6 +779,9 @@ window_pane_destroy(struct window_pane *wp)
evtimer_del(&wp->changes_timer);
if (wp->fd != -1) {
+#ifdef HAVE_UTEMPTER
+ utempter_remove_record(wp->fd);
+#endif
bufferevent_free(wp->event);
close(wp->fd);
}
@@ -810,6 +813,9 @@ window_pane_spawn(struct window_pane *wp, const char *cmd,
const char *shell,
char *argv0, paneid[16];
const char *ptr;
struct termios tio2;
+#ifdef HAVE_UTEMPTER
+ char s[32];
+#endif
if (wp->fd != -1) {
bufferevent_free(wp->event);
@@ -886,6 +892,11 @@ window_pane_spawn(struct window_pane *wp, const char *cmd,
const char *shell,
fatal("execl failed");
}
+#ifdef HAVE_UTEMPTER
+ xsnprintf(s, sizeof s, "tmux(%lu):%%%u", (long) getpid(), wp->id);
+ utempter_add_record(wp->fd, s);
+#endif
+
setblocking(wp->fd, 0);
wp->event = bufferevent_new(wp->fd,
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 7 +++++++
server-fn.c | 3 +++
tmux.h | 4 ++++
window.c | 11 +++++++++++
4 files changed, 25 insertions(+), 0 deletions(-)
hooks/post-receive
--
tmux
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs