1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00

Client flags was changed to uint64_t a while ago, fix a few cases where

it is still int (do not matter now but will with some new flags). From
Michael Grant.
This commit is contained in:
nicm 2024-08-26 07:30:46 +00:00
parent ad46cda3e5
commit ab0a70a753
5 changed files with 29 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: client.c,v 1.162 2024/05/15 09:59:12 nicm Exp $ */
/* $OpenBSD: client.c,v 1.163 2024/08/26 07:30:46 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -445,11 +445,12 @@ client_send_identify(const char *ttynam, const char *termname, char **caps,
{
char **ss;
size_t sslen;
int fd, flags = client_flags;
int fd;
uint64_t flags = client_flags;
pid_t pid;
u_int i;
proc_send(client_peer, MSG_IDENTIFY_FLAGS, -1, &flags, sizeof flags);
proc_send(client_peer, MSG_IDENTIFY_LONGFLAGS, -1, &flags, sizeof flags);
proc_send(client_peer, MSG_IDENTIFY_LONGFLAGS, -1, &client_flags,
sizeof client_flags);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: screen-redraw.c,v 1.96 2022/06/30 09:55:53 nicm Exp $ */
/* $OpenBSD: screen-redraw.c,v 1.97 2024/08/26 07:30:46 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -496,8 +496,8 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
}
/* Update status line and change flags if unchanged. */
static int
screen_redraw_update(struct client *c, int flags)
static uint64_t
screen_redraw_update(struct client *c, uint64_t flags)
{
struct window *w = c->session->curw->window;
struct window_pane *wp;
@ -567,7 +567,7 @@ void
screen_redraw_screen(struct client *c)
{
struct screen_redraw_ctx ctx;
int flags;
uint64_t flags;
if (c->flags & CLIENT_SUSPENDED)
return;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: server-client.c,v 1.405 2024/04/10 07:29:15 nicm Exp $ */
/* $OpenBSD: server-client.c,v 1.406 2024/08/26 07:30:46 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -1870,7 +1870,8 @@ server_client_key_callback(struct cmdq_item *item, void *data)
struct timeval tv;
struct key_table *table, *first;
struct key_binding *bd;
int xtimeout, flags;
int xtimeout;
uint64_t flags;
struct cmd_find_state fs;
key_code key0, prefix, prefix2;
@ -2569,7 +2570,8 @@ server_client_check_redraw(struct client *c)
struct tty *tty = &c->tty;
struct window *w = c->session->curw->window;
struct window_pane *wp;
int needed, flags, mode = tty->mode, new_flags = 0;
int needed, tty_flags, mode = tty->mode;
uint64_t client_flags = 0;
int redraw;
u_int bit = 0;
struct timeval tv = { .tv_usec = 1000 };
@ -2603,7 +2605,7 @@ server_client_check_redraw(struct client *c)
}
}
if (needed)
new_flags |= CLIENT_REDRAWPANES;
client_flags |= CLIENT_REDRAWPANES;
}
if (needed && (left = EVBUFFER_LENGTH(tty->out)) != 0) {
log_debug("%s: redraw deferred (%zu left)", c->name, left);
@ -2626,20 +2628,20 @@ server_client_check_redraw(struct client *c)
* If more that 64 panes, give up and
* just redraw the window.
*/
new_flags &= CLIENT_REDRAWPANES;
new_flags |= CLIENT_REDRAWWINDOW;
client_flags &= CLIENT_REDRAWPANES;
client_flags |= CLIENT_REDRAWWINDOW;
break;
}
}
if (c->redraw_panes != 0)
c->flags |= CLIENT_REDRAWPANES;
}
c->flags |= new_flags;
c->flags |= client_flags;
return;
} else if (needed)
log_debug("%s: redraw needed", c->name);
flags = tty->flags & (TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR);
tty_flags = tty->flags & (TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR);
tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE))|TTY_NOCURSOR;
if (~c->flags & CLIENT_REDRAWWINDOW) {
@ -2671,9 +2673,10 @@ server_client_check_redraw(struct client *c)
screen_redraw_screen(c);
}
tty->flags = (tty->flags & ~TTY_NOCURSOR)|(flags & TTY_NOCURSOR);
tty->flags = (tty->flags & ~TTY_NOCURSOR)|(tty_flags & TTY_NOCURSOR);
tty_update_mode(tty, mode, NULL);
tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR))|flags;
tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR))|
tty_flags;
c->flags &= ~(CLIENT_ALLREDRAWFLAGS|CLIENT_STATUSFORCE);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: server.c,v 1.206 2024/05/14 10:11:09 nicm Exp $ */
/* $OpenBSD: server.c,v 1.207 2024/08/26 07:30:46 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -104,8 +104,8 @@ server_check_marked(void)
}
/* Create server socket. */
static int
server_create_socket(int flags, char **cause)
int
server_create_socket(uint64_t flags, char **cause)
{
struct sockaddr_un sa;
size_t size;
@ -170,7 +170,7 @@ server_tidy_event(__unused int fd, __unused short events, __unused void *data)
/* Fork new server. */
int
server_start(struct tmuxproc *client, int flags, struct event_base *base,
server_start(struct tmuxproc *client, uint64_t flags, struct event_base *base,
int lockfd, char *lockfile)
{
int fd;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tmux.h,v 1.1224 2024/08/26 07:14:40 nicm Exp $ */
/* $OpenBSD: tmux.h,v 1.1225 2024/08/26 07:30:46 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@ -2703,10 +2703,12 @@ void server_clear_marked(void);
int server_is_marked(struct session *, struct winlink *,
struct window_pane *);
int server_check_marked(void);
int server_start(struct tmuxproc *, int, struct event_base *, int, char *);
int server_start(struct tmuxproc *, uint64_t, struct event_base *, int,
char *);
void server_update_socket(void);
void server_add_accept(int);
void printflike(1, 2) server_add_message(const char *, ...);
int server_create_socket(uint64_t, char **);
/* server-client.c */
RB_PROTOTYPE(client_windows, client_window, entry, server_client_window_cmp);