diff options
author | rahulp13 | 2020-12-14 20:33:34 +0530 |
---|---|---|
committer | rahulp13 | 2020-12-14 20:33:34 +0530 |
commit | 0029b5d209d0187f29ba774ab3ef0f3ff04a3215 (patch) | |
tree | 93aff8c4b123a5836c1301d8ffbb6356a6eafdba /src/outitf.c | |
parent | 1e5623110a735b75e6019ce9dc956704df9ded97 (diff) | |
download | nghdl-0029b5d209d0187f29ba774ab3ef0f3ff04a3215.tar.gz nghdl-0029b5d209d0187f29ba774ab3ef0f3ff04a3215.tar.bz2 nghdl-0029b5d209d0187f29ba774ab3ef0f3ff04a3215.zip |
changed temp location and updated server start command for win os
Diffstat (limited to 'src/outitf.c')
-rw-r--r-- | src/outitf.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/outitf.c b/src/outitf.c index 1ac92ab..3ccf209 100644 --- a/src/outitf.c +++ b/src/outitf.c @@ -55,12 +55,12 @@ Modified: 2000 AlansFixes, 2013/2015 patch by Krzysztof Blaszkowski #include <stdlib.h> #include <string.h> #include <errno.h> +#include <unistd.h> /* 27.May.2020 - BM - Added the following #include */ #ifdef __linux__ #include <sys/socket.h> #include <arpa/inet.h> - #include <unistd.h> #endif extern char *spice_analysis_get_name(int index); @@ -128,15 +128,17 @@ static bool savenone = FALSE; static void close_server() { FILE *fptr; - char ip_filename[48]; + char ip_filename[100]; #ifdef __linux__ sprintf(ip_filename, "/tmp/NGHDL_COMMON_IP_%d.txt", getpid()); #elif _WIN32 WSADATA WSAData; - SOCKADDR_IN addr; - WSAStartup(MAKEWORD(2, 2), &WSAData); - sprintf(ip_filename, "C:\\Windows\\Temp\\NGHDL_COMMON_IP_%d.txt", getpid()); + SOCKADDR_IN addr; + WSAStartup(MAKEWORD(2, 2), &WSAData); + char *base_path = getenv("LocalAppData"); + sprintf(ip_filename, "\\Temp\\NGHDL_COMMON_IP_%d.txt", getpid()); + sprintf(ip_filename, strcat(base_path, ip_filename)); #endif fptr = fopen(ip_filename, "r"); |