Ticket #9379: 30-mytharchive.diff

File 30-mytharchive.diff, 4.8 KB (added by Lawrence Rust <lvr@…>, 13 years ago)
  • mytharchive/mytharchive/archiveutil.cpp

    diff --git a/mytharchive/mytharchive/archiveutil.cpp b/mytharchive/mytharchive/archiveutil.cpp
    index 11d181a..1374d5a 100644
    a b  
    11// POSIX headers
     2#ifndef USING_MINGW
    23#include <sys/wait.h> // for WIF macros
     4#endif
    35#include <unistd.h>
    46
    57// ANSI C headers
  • mytharchive/mytharchive/main.cpp

    diff --git a/mytharchive/mytharchive/main.cpp b/mytharchive/mytharchive/main.cpp
    index f6e6e1d..54f7c79 100644
    a b static bool checkProcess(const QString &lockFile) 
    5555        return true;
    5656    }
    5757
     58#ifndef USING_MINGW
    5859    QString line(file.readLine(100));
    5960
    6061    pid_t pid = line.toInt(&bOK);
    static bool checkProcess(const QString &lockFile) 
    7273        if (errno == ESRCH)
    7374            return false;
    7475    }
     76#endif
    7577
    7678    return true;
    7779}
  • mytharchive/mytharchive/mythburn.cpp

    diff --git a/mytharchive/mytharchive/mythburn.cpp b/mytharchive/mytharchive/mythburn.cpp
    index 0c19b45..16e5329 100644
    a b  
    44#include <unistd.h>
    55#include <iostream>
    66#include <cstdlib>
     7#ifndef USING_MINGW
    78#include <sys/wait.h>  // for WIFEXITED and WEXITSTATUS
     9#endif
    810
    911// qt
    1012#include <QDir>
  • mytharchive/mytharchivehelper/main.cpp

    diff --git a/mytharchive/mytharchivehelper/main.cpp b/mytharchive/mytharchivehelper/main.cpp
    index c67795e..caa2e81 100644
    a b  
    2626
    2727#include <iostream>
    2828#include <stdint.h>
     29#ifndef USING_MINGW
    2930#include <sys/wait.h>  // for WIFEXITED and WEXITSTATUS
     31#endif
    3032#include <unistd.h>
    3133#include <cstdlib>
    3234
    NativeArchive::NativeArchive(void) 
    9496    QString command = QString("echo %1 > " + tempDir +
    9597                      "/logs/mythburn.lck").arg(getpid());
    9698    int res = system(qPrintable(command));
     99#ifndef USING_MINGW
    97100    if (WIFEXITED(res) == 0)
     101#else
     102    if (res == 0)
     103#endif
    98104        VERBOSE(VB_IMPORTANT, "NativeArchive: Failed to create lock file");
    99105}
    100106
    static bool createISOImage(QString &sourceDirectory) 
    199205    command += tempDirectory + "mythburn.iso " + sourceDirectory;
    200206
    201207    int res = system(qPrintable(command));
     208#ifndef USING_MINGW
    202209    if (WIFEXITED(res))
    203210        res = WEXITSTATUS(res);
     211#endif
    204212    if (res != 0)
    205213    {
    206214        VERBOSE(VB_JOBQUEUE, QString("ERROR: Failed while running mkisofs. Result: %1")
    static int burnISOImage(int mediaType, bool bEraseDVDRW, bool nativeFormat) 
    257265    }
    258266
    259267    int res = system(qPrintable(command));
     268#ifndef USING_MINGW
    260269    if (WIFEXITED(res))
    261270        res = WEXITSTATUS(res);
     271#endif
    262272    if (res == 0)
    263273        VERBOSE(VB_JOBQUEUE, "Finished burning ISO image");
    264274    else
    int NativeArchive::doNativeArchive(const QString &jobFile) 
    349359        saveDirectory += "work/";
    350360
    351361        int res = system(qPrintable("rm -fr " + saveDirectory + "*"));
     362#ifndef USING_MINGW
    352363        if (!WIFEXITED(res) || WEXITSTATUS(res))
     364#else
     365        if (res)
     366#endif
    353367            VERBOSE(VB_IMPORTANT, "NativeArchive: Failed to clear work directory");
    354368    }
    355369
    static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int 
    18731887    AVPacket pkt;
    18741888    AVPicture orig;
    18751889    AVPicture retbuf;
    1876     bzero(&orig, sizeof(AVPicture));
    1877     bzero(&retbuf, sizeof(AVPicture));
     1890    std::memset(&orig, 0, sizeof(AVPicture));
     1891    std::memset(&retbuf, 0, sizeof(AVPicture));
    18781892
    18791893    int bufflen = width * height * 4;
    18801894    unsigned char *outputbuf = new unsigned char[bufflen];
    static int isRemote(QString filename) 
    24382452    if (!QFile::exists(filename))
    24392453        return 0;
    24402454
     2455#if CONFIG_DARWIN
    24412456    struct statfs statbuf;
    2442     bzero(&statbuf, sizeof(statbuf));
     2457    std::memset(&statbuf, 0, sizeof(statbuf));
    24432458
    2444 #if CONFIG_DARWIN
    24452459    if ((statfs(qPrintable(filename), &statbuf) == 0) &&
    24462460        ((!strcmp(statbuf.f_fstypename, "nfs")) ||      // NFS|FTP
    24472461            (!strcmp(statbuf.f_fstypename, "afpfs")) || // ApplShr
    24482462            (!strcmp(statbuf.f_fstypename, "smbfs"))))  // SMB
    24492463        return 2;
    24502464#elif __linux__
     2465    struct statfs statbuf;
     2466    std::memset(&statbuf, 0, sizeof(statbuf));
     2467
    24512468    if ((statfs(qPrintable(filename), &statbuf) == 0) &&
    24522469        ((statbuf.f_type == 0x6969) ||      // NFS
    24532470            (statbuf.f_type == 0x517B)))    // SMB
  • mytharchive/mytharchivehelper/pxsup2dast.c

    diff --git a/mytharchive/mytharchivehelper/pxsup2dast.c b/mytharchive/mytharchivehelper/pxsup2dast.c
    index 4b5f542..cc80510 100644
    a b static void xfseek0(FILE * stream, long offset) 
    275275
    276276static void xmkdir(const char * path, int mode)
    277277{
     278#ifdef USING_MINGW
     279    if (mkdir(path) < 0)
     280#else
    278281    if (mkdir(path, mode) < 0)
     282#endif
    279283        exc_throw(MiscError, "mkdir(%s, 0%o) failure:", path, mode);
    280284}
    281285