=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/machine.c,v retrieving revision 1.112 retrieving revision 1.113 diff -c -r1.112 -r1.113 *** src/usr.bin/top/machine.c 2022/09/10 16:58:51 1.112 --- src/usr.bin/top/machine.c 2023/01/07 05:24:59 1.113 *************** *** 1,4 **** ! /* $OpenBSD: machine.c,v 1.112 2022/09/10 16:58:51 cheloha Exp $ */ /*- * Copyright (c) 1994 Thorsten Lockert --- 1,4 ---- ! /* $OpenBSD: machine.c,v 1.113 2023/01/07 05:24:59 guenther Exp $ */ /*- * Copyright (c) 1994 Thorsten Lockert *************** *** 390,395 **** --- 390,398 ---- /* Filter set, process name needs to contain term */ if (strstr(proc->p_comm, term)) return 1; + /* If thread name set, search that too */ + if (strstr(proc->p_name, term)) + return 1; /* If showing arguments, search those as well */ if (show_args) { args = get_proc_args(proc); *************** *** 518,539 **** char **p, **s; extern int show_args; ! if (!show_args) ! return (kp->p_comm); ! ! s = get_proc_args(kp); ! if (s == NULL) ! return kp->p_comm; ! ! buf[0] = '\0'; ! for (p = s; *p != NULL; p++) { ! if (p != s) ! strlcat(buf, " ", sizeof(buf)); ! strlcat(buf, *p, sizeof(buf)); } ! if (buf[0] == '\0') ! return (kp->p_comm); ! return (buf); } void --- 521,542 ---- char **p, **s; extern int show_args; ! if (show_args && (s = get_proc_args(kp)) != NULL) { ! buf[0] = '\0'; ! for (p = s; *p != NULL; p++) { ! if (p != s) ! strlcat(buf, " ", sizeof(buf)); ! strlcat(buf, *p, sizeof(buf)); ! } ! if (buf[0] != '\0') ! return buf; } ! if (kp->p_name[0] != '\0') { ! snprintf(buf, sizeof buf, "%s/%s", kp->p_comm, ! kp->p_name); ! return buf; ! } ! return kp->p_comm; } void