fix some little bugs, test client and server @dummy camera

This commit is contained in:
2022-03-18 15:28:47 +03:00
parent ebf6a53d63
commit c452b36a16
12 changed files with 334 additions and 230 deletions

View File

@@ -76,32 +76,11 @@ static char *getans(int sock){
buf[n] = 0;
DBG("Got from server: %s", buf);
verbose(1, "%s", buf);
if(buf[n-1] == '\n') break;
}
return ans;
}
static char *makeabspath(const char *path){
static char buf[PATH_MAX];
if(!path) return NULL;
char *ret = NULL;
int unl = 0;
FILE *f = fopen(path, "r");
if(!f){
f = fopen(path, "a");
if(!f){
ERR("Can't create %s", path);
return NULL;
}
unl = 1;
}
if(!realpath(path, buf)){
ERR("realpath()");
}else ret = buf;
fclose(f);
if(unl) unlink(path);
return ret;
}
/**
* @brief processData - process here some actions and make messages for server
*/