summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2018-08-18 20:08:52 +0000
committernicm <nicm>2018-08-18 20:08:52 +0000
commitbd2896b65e8fd205e3207ed70558d9ebfd106909 (patch)
tree1001e1beeb6e0cf1332e246af8bcbdc4898c9803 /cmd-find.c
parent3bc08b0dc0c9868ba5acaa7b8f12159a9a66cf4a (diff)
SESSION_UNATTACHED flag is no longer necessary now we have an attached
count instead.
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd-find.c b/cmd-find.c
index ff95ae1f..fe5bb3e0 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -136,7 +136,7 @@ cmd_find_best_client(struct session *s)
{
struct client *c_loop, *c;
- if (s->flags & SESSION_UNATTACHED)
+ if (s->attached == 0)
s = NULL;
c = NULL;
@@ -160,10 +160,10 @@ cmd_find_session_better(struct session *s, struct session *than, int flags)
if (than == NULL)
return (1);
if (flags & CMD_FIND_PREFER_UNATTACHED) {
- attached = (~than->flags & SESSION_UNATTACHED);
- if (attached && (s->flags & SESSION_UNATTACHED))
+ attached = (than->attached != 0);
+ if (attached && s->attached == 0)
return (1);
- else if (!attached && (~s->flags & SESSION_UNATTACHED))
+ else if (!attached && s->attached != 0)
return (0);
}
return (timercmp(&s->activity_time, &than->activity_time, >));