add anonymous UNIX-sockets

This commit is contained in:
2022-02-03 15:46:38 +03:00
parent 5eb3a2e4fd
commit 215bd88698
4 changed files with 180 additions and 3 deletions

View File

@@ -308,7 +308,11 @@ static TTY_descr *openserialdev(char *path, int speed){
int start_socket(int server, char *path, TTY_descr **dev){
char apath[128];
DBG("path: %s", path);
if(strncmp("\\0", path, 2) == 0){
if(*path == 0){
DBG("convert name");
apath[0] = 0;
strncpy(apath+1, path+1, 126);
}else if(strncmp("\\0", path, 2) == 0){
DBG("convert name");
apath[0] = 0;
strncpy(apath+1, path+2, 126);