summaryrefslogtreecommitdiff
path: root/android/pan.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-01-10 16:09:06 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-01-13 10:21:18 +0100
commitcd8e32577971cf6d8131408951385de8fbbcc3e5 (patch)
tree2325c3c95986791a7a2b57af3197200915a7815a /android/pan.c
parent20016a169c3043a909e0ff897c3a08e2c2420e8f (diff)
downloadbluez-cd8e32577971cf6d8131408951385de8fbbcc3e5.tar.gz
android/pan: Generate file path in compile time
This reduce need of using snprintf function and removes need of manual buffer size calculation.
Diffstat (limited to 'android/pan.c')
-rw-r--r--android/pan.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/android/pan.c b/android/pan.c
index 205da71d2..dfd77621c 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -50,9 +50,9 @@
#include "bluetooth.h"
#define SVC_HINT_NETWORKING 0x02
-#define BNEP_BRIDGE "bnep"
-#define FORWARD_DELAY_PATH "/sys/class/net/%s/bridge/forward_delay"
-#define DELAY_PATH_MAX 41
+
+#define BNEP_BRIDGE "bnep"
+#define FORWARD_DELAY_PATH "/sys/class/net/"BNEP_BRIDGE"/bridge/forward_delay"
static bdaddr_t adapter_addr;
GSList *devices = NULL;
@@ -470,11 +470,8 @@ failed:
static int set_forward_delay(void)
{
int fd, ret;
- char path[DELAY_PATH_MAX];
-
- snprintf(path, sizeof(path), FORWARD_DELAY_PATH, BNEP_BRIDGE);
- fd = open(path, O_RDWR);
+ fd = open(FORWARD_DELAY_PATH, O_RDWR);
if (fd < 0)
return -errno;