Ticket #6597: 6597-backend-win32.2.patch

File 6597-backend-win32.2.patch, 3.2 KB (added by Jeff Lu <jll544@…>, 15 years ago)

Replaces previous patch; uses explicit paths; adds mythsocket fix

  • libs/libmyth/mythcontext.cpp

     
    15471547{
    15481548#if defined(CONFIG_DARWIN) || (__FreeBSD__) || defined(__OpenBSD__)
    15491549    const char *command = "ps -ax | grep -i mythbackend | grep -v grep > /dev/null";
     1550#elif defined USING_MINGW
     1551    const char *command = "%systemroot%\\system32\\tasklist.exe "
     1552       " | %systemroot%\\system32\\find.exe /i \"mythbackend.exe\" ";
    15501553#else
    15511554    const char *command = "ps -ae | grep mythbackend > /dev/null";
    15521555#endif
  • libs/libmyth/util.cpp

     
    11181118    if (GetTempFileNameA(temppath, "mth", 0, tempfilename))
    11191119    {
    11201120        if (dir)
     1121        {
     1122            // GetTempFileNameA creates the file, so delete it before mkdir
     1123            unlink(tempfilename);
    11211124            ret = mkdir(tempfilename);
     1125        }
    11221126        else
    11231127            ret = open(tempfilename, O_CREAT | O_RDWR, S_IREAD | S_IWRITE);
    11241128    }
  • libs/libmythui/mythsystem.cpp

     
    178178            VERBOSE(VB_IMPORTANT,
    179179                    (LOC_ERR + "WaitForSingleObject() failed because %1")
    180180                    .arg(::GetLastError()));
     181        DWORD exitcode = GENERIC_EXIT_OK;
     182        if (!GetExitCodeProcess(pi.hProcess, &exitcode))
     183            VERBOSE(VB_IMPORTANT, (LOC_ERR +
     184                    "GetExitCodeProcess() failed because %1")
     185                    .arg(::GetLastError()));
    181186        CloseHandle(pi.hProcess);
    182187        CloseHandle(pi.hThread);
    183         return GENERIC_EXIT_OK;
     188        // VERBOSE(VB_IMPORTANT, cmd + QString(" returned %1").arg(exitcode));
     189        return exitcode;
    184190    }
    185191#endif
    186192    return GENERIC_EXIT_NOT_OK;
  • libs/libmythtv/ThreadedFileWriter.cpp

     
    161161    }
    162162    else
    163163    {
     164#ifdef USING_MINGW
     165        _setmode(fd, _O_BINARY);
     166#endif
    164167        buf = new char[TFW_DEF_BUF_SIZE + 1024];
    165168        bzero(buf, TFW_DEF_BUF_SIZE + 64);
    166169
  • libs/libmythdb/mythsocket.cpp

     
    4242{
    4343    VERBOSE(VB_SOCKET, LOC + "new socket");
    4444    if (socket > -1)
     45    {
    4546        setSocket(socket);
     47#ifdef USING_MINGW
     48        // Windows sockets' default buffersize is too small for streaming
     49        // Could this apply to other platforms, too?
     50        setSendBufferSize(kSocketBufferSize);
     51        // VERBOSE(VB_SOCKET, QString("rcvbuf = %1, sndbuf=%2")
     52        //         .arg(receiveBufferSize()).arg(sendBufferSize()));
     53#endif 
     54    }
    4655
    4756    if (m_cb)
    4857        m_readyread_thread.AddToReadyRead(this);