Skip to content

Conversation

@alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Oct 24, 2025

Let's keep it simple.

@alejandro-colomar alejandro-colomar changed the title is_my_tty(): Fix and simplify lib/utmp.c: is_my_tty(): Fix and simplify Oct 24, 2025
@alejandro-colomar alejandro-colomar force-pushed the mytty branch 2 times, most recently from b4a9595 to be26914 Compare October 24, 2025 10:26
@alejandro-colomar alejandro-colomar changed the title lib/utmp.c: is_my_tty(): Fix and simplify lib/utmp.c: is_my_tty(): Simplify Oct 24, 2025
@alejandro-colomar alejandro-colomar force-pushed the mytty branch 5 times, most recently from b5249fb to 3c46edb Compare October 24, 2025 10:57
The method for checking for truncation was quite weird.  By not caching
ttyname(3), we use it directly, without needing a temporary copy, which
removes opportunities for bugs.

Signed-off-by: Alejandro Colomar <[email protected]>
This name makes the function definition more readable.

Signed-off-by: Alejandro Colomar <[email protected]>
And use it instead of its pattern.

This macro enforces correct use of ttyname_r(3) with arrays.

Signed-off-by: Alejandro Colomar <[email protected]>
@alejandro-colomar alejandro-colomar marked this pull request as ready for review October 27, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant