Commits

nicm  committed 7940cac

Put helper function back, will be needed in a bit.

  • Participants
  • Parent commits 21b64f7

Comments (0)

Files changed (4)

File usr.bin/tmux/cmd-server-info.c

-/* $OpenBSD: cmd-server-info.c,v 1.28 2012/11/22 14:26:04 nicm Exp $ */
+/* $OpenBSD: cmd-server-info.c,v 1.29 2012/11/22 14:41:11 nicm Exp $ */
 
 /*
  * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
 		    "class=%u] [flags=0x%x/0x%x, references=%u]", i,
 		    c->tty.path, c->ibuf.fd, c->tty.fd, c->session->name,
 		    c->tty.sx, c->tty.sy, c->tty.termname,
-		    c->tty.tio.c_cc[VERASE], c->tty.service_class,
+		    c->tty.tio.c_cc[VERASE], c->tty.class,
 		    c->flags, c->tty.flags, c->references);
 	}
 	ctx->print(ctx, "%s", "");

File usr.bin/tmux/tmux.h

-/* $OpenBSD: tmux.h,v 1.363 2012/11/22 14:26:04 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.364 2012/11/22 14:41:11 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 	struct client	*client;
 
 	char		*path;
-	u_int		 service_class;
+	u_int		 class;
 
 	u_int		 sx;
 	u_int		 sy;
 void	tty_init(struct tty *, struct client *, int, char *);
 int	tty_resize(struct tty *);
 int	tty_set_size(struct tty *, u_int, u_int);
+void	tty_set_class(struct tty *, u_int);
 void	tty_start_tty(struct tty *);
 void	tty_stop_tty(struct tty *);
 void	tty_set_title(struct tty *, const char *);

File usr.bin/tmux/tty-keys.c

-/* $OpenBSD: tty-keys.c,v 1.46 2012/11/22 14:26:04 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.47 2012/11/22 14:41:11 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 int
 tty_keys_device(struct tty *tty, const char *buf, size_t len, size_t *size)
 {
-	u_int i, n;
+	u_int i, class;
 	char  tmp[64], *endptr;
 
 	/*
 		return (0);
 
 	/* Convert service class. */
-	n = strtoul(tmp, &endptr, 10);
+	class = strtoul(tmp, &endptr, 10);
 	if (*endptr != ';')
-		n = 0;
+		class = 0;
 
-	log_debug("received service class %u", n);
-	tty->service_class = n;
+	log_debug("received service class %u", class);
+	tty_set_class(tty, class);
 
 	return (0);
 }

File usr.bin/tmux/tty.c

-/* $OpenBSD: tty.c,v 1.144 2012/11/22 14:26:04 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.145 2012/11/22 14:41:11 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 }
 
 void
+tty_set_class(struct tty *tty, u_int class)
+{
+	if (tty->class != 0)
+		return;
+	tty->class = class;
+}
+
+void
 tty_stop_tty(struct tty *tty)
 {
 	struct winsize	ws;