Show "(inactive)" rather than an invalid pty device name for ondemand consoles that are closed.

Show "(inactive)" rather than "(null)" for ondemand consoles that have never been opened.
This commit is contained in:
Greg Becker 2024-05-25 17:31:55 -05:00
parent f6f3999437
commit c3a4e61906
2 changed files with 5 additions and 2 deletions

View File

@ -798,6 +798,8 @@ ConsDown(CONSENT *pCE, FLAG downHard, FLAG force)
if (pCE->type == EXEC && pCE->execSlaveFD != 0) {
close(pCE->execSlaveFD);
pCE->execSlaveFD = 0;
free(pCE->execSlave);
pCE->execSlave = NULL;
}
pCE->fup = 0;
pCE->nolog = 0;

View File

@ -2175,7 +2175,7 @@ CommandExamine(GRPENT *pGE, CONSCLIENT *pCLServing, CONSENT *pCEServing,
char p = '\000';
switch (pCE->type) {
case EXEC:
d = pCE->execSlave;
d = (pCE->execSlaveFD > 0) ? pCE->execSlave : "(inactive)";
b = "Local";
p = ' ';
break;
@ -2343,7 +2343,8 @@ CommandInfo(GRPENT *pGE, CONSCLIENT *pCLServing, CONSENT *pCEServing,
case EXEC:
FilePrint(pCLServing->fd, FLAGTRUE, "|:%s,%lu,%s,%d:",
(pCE->exec != (char *)0 ? pCE->exec : "/bin/sh"),
(unsigned long)pCE->ipid, pCE->execSlave,
(unsigned long)pCE->ipid,
(pCE->execSlaveFD > 0) ? pCE->execSlave : "(inactive)",
FileFDNum(pCE->cofile));
break;
#if HAVE_FREEIPMI