From e186eb7319224c9d02f8ad03009ccf3be211da7b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 24 Sep 2020 08:26:37 -0400 Subject: [PATCH] Fix problem with autocons autocons needed to open the devnode earlier to have the correct name. Fixes TSM autocons behavior --- confluent_osdeploy/utils/autocons.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/utils/autocons.c b/confluent_osdeploy/utils/autocons.c index 1d555149..018f43b5 100644 --- a/confluent_osdeploy/utils/autocons.c +++ b/confluent_osdeploy/utils/autocons.c @@ -51,6 +51,7 @@ int main(int argc, char* argv[]) { } else { exit(0); } + ttyf = open(buff, O_RDWR | O_NOCTTY); if (currspeed == SPEED9600) { cspeed = B9600; strcpy(offset, ",9600"); @@ -66,8 +67,6 @@ int main(int argc, char* argv[]) { } else { exit(0); } - printf("%s\n", buff); - ttyf = open(buff, O_RDWR | O_NOCTTY); tcgetattr(ttyf, &tty); if (cspeed) { cfsetospeed(&tty, B115200); @@ -75,6 +74,7 @@ int main(int argc, char* argv[]) { } tcsetattr(ttyf, TCSANOW, &tty); ioctl(ttyf, TIOCCONS, 0); + printf("%s\n", buff); }