bluetoothd[578]: binding UNIX socket: No such file or directory
bluetoothd[578]: Server initialization failed
0, unix_sockend sdp server -------
memset(&unaddr, 0, sizeof(unaddr));
unaddr.sun_family = AF_UNIX;
strcpy(unaddr.sun_path, SDP_UNIX_PATH);
unlink(unaddr.sun_path);
if (bind(unix_sock, (struct sockaddr *) &unaddr, sizeof(unaddr)) < 0) {
error("binding UNIX socket: %s", strerror(errno));
return -1;
}
#define SDP_UNIX_PATH "/var/run/sdp"
问题在于开发板上面只有文件夹/var, /var目录下面没有文件夹run,就会报错
No such file or directory
解决方法: 在文件夹/var下面创建文件夹run
cd /var
mkdir run
或者在脚本里面加入mkdir -p /var/run
最好的方法是修改路径为/test/sdp