mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Make process name guessing pick up SSTOP.
This commit is contained in:
parent
69ebc15808
commit
1d3fba86a3
2
TODO
2
TODO
@ -86,3 +86,5 @@
|
|||||||
- 88 colour support; new grid cell flag, and 256<->88 88<->16 translation tables
|
- 88 colour support; new grid cell flag, and 256<->88 88<->16 translation tables
|
||||||
- some fix for SF feature request 2527847 - now remain-by-default has gone
|
- some fix for SF feature request 2527847 - now remain-by-default has gone
|
||||||
cannot control it per-session
|
cannot control it per-session
|
||||||
|
- if the child is suspended in window with eg ^Z it should be restarted, or
|
||||||
|
^Z should be ignored
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: osdep-freebsd.c,v 1.4 2009-01-27 23:10:18 nicm Exp $ */
|
/* $Id: osdep-freebsd.c,v 1.5 2009-02-07 19:16:25 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -36,6 +36,11 @@ char *get_proc_argv0(pid_t);
|
|||||||
|
|
||||||
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||||
|
|
||||||
|
#define is_runnable(p) \
|
||||||
|
((p)->ki_stat == SRUN || (p)->ki_stat == SIDL)
|
||||||
|
#define is_stopped(p) \
|
||||||
|
((p)->ki_stat == SSTOP || (p)->ki_stat == SZOMB || (p)->ki_stat == SDEAD)
|
||||||
|
|
||||||
char *
|
char *
|
||||||
get_argv0(__attribute__ ((unused)) int fd, char *tty)
|
get_argv0(__attribute__ ((unused)) int fd, char *tty)
|
||||||
{
|
{
|
||||||
@ -78,8 +83,11 @@ retry:
|
|||||||
if (bestp == NULL)
|
if (bestp == NULL)
|
||||||
bestp = p;
|
bestp = p;
|
||||||
|
|
||||||
if (p->ki_stat != SRUN && p->ki_stat != SIDL)
|
if (is_runnable(p) && !is_runnable(bestp))
|
||||||
continue;
|
bestp = p;
|
||||||
|
if (!is_stopped(p) && is_stopped(bestp))
|
||||||
|
bestp = p;
|
||||||
|
|
||||||
if (p->ki_estcpu < bestp->ki_estcpu)
|
if (p->ki_estcpu < bestp->ki_estcpu)
|
||||||
continue;
|
continue;
|
||||||
if (p->ki_slptime > bestp->ki_slptime)
|
if (p->ki_slptime > bestp->ki_slptime)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: osdep-openbsd.c,v 1.7 2009-01-30 21:18:26 nicm Exp $ */
|
/* $Id: osdep-openbsd.c,v 1.8 2009-02-07 19:16:25 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -30,6 +30,11 @@
|
|||||||
|
|
||||||
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
||||||
|
|
||||||
|
#define is_runnable(p) \
|
||||||
|
((p)->p_stat == SRUN || (p)->p_stat == SIDL || (p)->p_stat == SONPROC)
|
||||||
|
#define is_stopped(p) \
|
||||||
|
((p)->p_stat == SSTOP || (p)->p_stat == SZOMB || (p)->p_stat == SDEAD)
|
||||||
|
|
||||||
char *get_argv0(int, char *);
|
char *get_argv0(int, char *);
|
||||||
char *get_proc_argv0(pid_t);
|
char *get_proc_argv0(pid_t);
|
||||||
|
|
||||||
@ -76,17 +81,18 @@ retry:
|
|||||||
if (bestp == NULL)
|
if (bestp == NULL)
|
||||||
bestp = p;
|
bestp = p;
|
||||||
|
|
||||||
if (p->p_stat != SRUN &&
|
if (is_runnable(p) && !is_runnable(bestp))
|
||||||
p->p_stat != SIDL &&
|
bestp = p;
|
||||||
p->p_stat != SONPROC)
|
if (!is_stopped(p) && is_stopped(bestp))
|
||||||
continue;
|
bestp = p;
|
||||||
|
|
||||||
if (p->p_estcpu < bestp->p_estcpu)
|
if (p->p_estcpu < bestp->p_estcpu)
|
||||||
continue;
|
continue;
|
||||||
if (p->p_slptime > bestp->p_slptime)
|
if (p->p_slptime > bestp->p_slptime)
|
||||||
continue;
|
continue;
|
||||||
if (!(p->p_flag & P_SINTR) && bestp->p_flag & P_SINTR)
|
if (!(p->p_flag & P_SINTR) && bestp->p_flag & P_SINTR)
|
||||||
continue;
|
continue;
|
||||||
if (p->p_pid < bestp->p_pid)
|
if (LIST_FIRST(&p->p_children) != NULL)
|
||||||
continue;
|
continue;
|
||||||
bestp = p;
|
bestp = p;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user