fs_cli works on windows

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10937 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-12-23 23:26:37 +00:00
parent e7c4953c99
commit d4ae1a8f1c
3 changed files with 16 additions and 3 deletions

View File

@ -1724,6 +1724,7 @@ Global
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.Build.0 = Release|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|Any CPU
{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.ActiveCfg = Debug|Win32
{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.Build.0 = Debug|Win32
@ -1768,8 +1769,10 @@ Global
{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|Win32
{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.ActiveCfg = Debug|Win32
{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.Build.0 = Debug|Win32
{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.ActiveCfg = Debug|Win32
{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.ActiveCfg = Release|Win32
{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.Build.0 = Release|Win32
{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution

View File

@ -207,9 +207,9 @@ int main(int argc, char *argv[])
char cfile[512] = "/tmp/fs_cli_config";
char *home = getenv("HOME");
#else
char hfile[512] = "c:\\fs_cli_history";
char cfile[512] = "c:\\fs_cli_config";
char *home = getenv("HOME");
char hfile[512] = ".\\fs_cli_history";
char cfile[512] = ".\\fs_cli_config";
char *home = ""; //getenv("HOME");
#endif
strncpy(profiles[0].host, "127.0.0.1", sizeof(profiles[0].host));

View File

@ -482,6 +482,16 @@ ESL_DECLARE(esl_status_t) esl_connect(esl_handle_t *handle, const char *host, es
char sendbuf[256];
int rval = 0;
const char *hval;
#ifdef WIN32
WORD wVersionRequested = MAKEWORD(2, 0);
WSADATA wsaData;
int err = WSAStartup(wVersionRequested, &wsaData);
if (err != 0) {
snprintf(handle->err, sizeof(handle->err), "WSAStartup Error");
return ESL_FAIL;
}
#endif
if (!handle->mutex) {
esl_mutex_create(&handle->mutex);