diff mbox series

[BlueZ,1/3] shared/shell: Add bt_shell_get_timeout()

Message ID 20240912092253.119754-2-hadess@hadess.net
State New
Headers show
Series Fix bluetoothctl hanging if daemon isn't running | expand

Commit Message

Bastien Nocera Sept. 12, 2024, 9:20 a.m. UTC
Make it possible to get the value of the general --timeout option.
---
 src/shared/shell.c | 5 +++++
 src/shared/shell.h | 2 ++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 246de209e41c..c31487190d0f 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1670,3 +1670,8 @@  void *bt_shell_get_env(const char *name)
 
 	return env->value;
 }
+
+int bt_shell_get_timeout(void)
+{
+	return data.timeout;
+}
diff --git a/src/shared/shell.h b/src/shared/shell.h
index a9a635bda959..b03250cac80f 100644
--- a/src/shared/shell.h
+++ b/src/shared/shell.h
@@ -85,4 +85,6 @@  bool bt_shell_detach(void);
 void bt_shell_set_env(const char *name, void *value);
 void *bt_shell_get_env(const char *name);
 
+int bt_shell_get_timeout(void);
+
 void bt_shell_cleanup(void);