8000 tty: provide tty_name() even without CONFIG_TTY · bsd-unix/linux@188e3c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 188e3c5

Browse files
arndbpcmoore
authored andcommitted
tty: provide tty_name() even without CONFIG_TTY
The audit subsystem just started printing the name of the tty, but that causes a build failure when CONFIG_TTY is disabled: kernel/built-in.o: In function `audit_log_task_info': memremap.c:(.text+0x5e34c): undefined reference to `tty_name' kernel/built-in.o: In function `audit_set_loginuid': memremap.c:(.text+0x63b34): undefined reference to `tty_name' This adds tty_name() to the list of functions that are provided as trivial stubs in that configuration. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: db0a6fb< 8000 /tt> ("audit: add tty field to LOGIN event") Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent db0a6fb commit 188e3c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/linux/tty.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ extern void proc_clear_tty(struct task_struct *p);
371371
extern struct tty_struct *get_current_tty(void);
372372
/* tty_io.c */
373373
extern int __init tty_init(void);
374+
extern const char *tty_name(const struct tty_struct *tty);
374375
#else
375376
static inline void console_init(void)
376377
{ }
@@ -391,6 +392,8 @@ static inline struct tty_struct *get_current_tty(void)
391392
/* tty_io.c */
392393
static inline int __init tty_init(void)
393394
{ return 0; }
395+
static inline const char *tty_name(const struct tty_struct *tty)
396+
{ return "(none)"; }
394397
#endif
395398

396399
extern struct ktermios tty_std_termios;
@@ -415,7 +418,6 @@ static inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
415418
return tty;
416419
}
417420

418-
extern const char *tty_name(const struct tty_struct *tty);
419421
extern const char *tty_driver_name(const struct tty_struct *tty);
420422
extern void tty_wait_until_sent(struct tty_struct *tty, long timeout);
421423
extern int __tty_check_change(struct tty_struct *tty, int sig);

0 commit co 307B mments

Comments
 (0)
0