diff --git a/mytharchive/mytharchive/archiveutil.cpp b/mytharchive/mytharchive/archiveutil.cpp
index 11d181a..1374d5a 100644
a
|
b
|
|
1 | 1 | // POSIX headers |
| 2 | #ifndef USING_MINGW |
2 | 3 | #include <sys/wait.h> // for WIF macros |
| 4 | #endif |
3 | 5 | #include <unistd.h> |
4 | 6 | |
5 | 7 | // ANSI C headers |
diff --git a/mytharchive/mytharchive/main.cpp b/mytharchive/mytharchive/main.cpp
index f6e6e1d..54f7c79 100644
a
|
b
|
static bool checkProcess(const QString &lockFile) |
55 | 55 | return true; |
56 | 56 | } |
57 | 57 | |
| 58 | #ifndef USING_MINGW |
58 | 59 | QString line(file.readLine(100)); |
59 | 60 | |
60 | 61 | pid_t pid = line.toInt(&bOK); |
… |
… |
static bool checkProcess(const QString &lockFile) |
72 | 73 | if (errno == ESRCH) |
73 | 74 | return false; |
74 | 75 | } |
| 76 | #endif |
75 | 77 | |
76 | 78 | return true; |
77 | 79 | } |
diff --git a/mytharchive/mytharchive/mythburn.cpp b/mytharchive/mytharchive/mythburn.cpp
index 0c19b45..16e5329 100644
a
|
b
|
|
4 | 4 | #include <unistd.h> |
5 | 5 | #include <iostream> |
6 | 6 | #include <cstdlib> |
| 7 | #ifndef USING_MINGW |
7 | 8 | #include <sys/wait.h> // for WIFEXITED and WEXITSTATUS |
| 9 | #endif |
8 | 10 | |
9 | 11 | // qt |
10 | 12 | #include <QDir> |
diff --git a/mytharchive/mytharchivehelper/main.cpp b/mytharchive/mytharchivehelper/main.cpp
index c67795e..caa2e81 100644
a
|
b
|
|
26 | 26 | |
27 | 27 | #include <iostream> |
28 | 28 | #include <stdint.h> |
| 29 | #ifndef USING_MINGW |
29 | 30 | #include <sys/wait.h> // for WIFEXITED and WEXITSTATUS |
| 31 | #endif |
30 | 32 | #include <unistd.h> |
31 | 33 | #include <cstdlib> |
32 | 34 | |
… |
… |
NativeArchive::NativeArchive(void) |
94 | 96 | QString command = QString("echo %1 > " + tempDir + |
95 | 97 | "/logs/mythburn.lck").arg(getpid()); |
96 | 98 | int res = system(qPrintable(command)); |
| 99 | #ifndef USING_MINGW |
97 | 100 | if (WIFEXITED(res) == 0) |
| 101 | #else |
| 102 | if (res == 0) |
| 103 | #endif |
98 | 104 | VERBOSE(VB_IMPORTANT, "NativeArchive: Failed to create lock file"); |
99 | 105 | } |
100 | 106 | |
… |
… |
static bool createISOImage(QString &sourceDirectory) |
199 | 205 | command += tempDirectory + "mythburn.iso " + sourceDirectory; |
200 | 206 | |
201 | 207 | int res = system(qPrintable(command)); |
| 208 | #ifndef USING_MINGW |
202 | 209 | if (WIFEXITED(res)) |
203 | 210 | res = WEXITSTATUS(res); |
| 211 | #endif |
204 | 212 | if (res != 0) |
205 | 213 | { |
206 | 214 | VERBOSE(VB_JOBQUEUE, QString("ERROR: Failed while running mkisofs. Result: %1") |
… |
… |
static int burnISOImage(int mediaType, bool bEraseDVDRW, bool nativeFormat) |
257 | 265 | } |
258 | 266 | |
259 | 267 | int res = system(qPrintable(command)); |
| 268 | #ifndef USING_MINGW |
260 | 269 | if (WIFEXITED(res)) |
261 | 270 | res = WEXITSTATUS(res); |
| 271 | #endif |
262 | 272 | if (res == 0) |
263 | 273 | VERBOSE(VB_JOBQUEUE, "Finished burning ISO image"); |
264 | 274 | else |
… |
… |
int NativeArchive::doNativeArchive(const QString &jobFile) |
349 | 359 | saveDirectory += "work/"; |
350 | 360 | |
351 | 361 | int res = system(qPrintable("rm -fr " + saveDirectory + "*")); |
| 362 | #ifndef USING_MINGW |
352 | 363 | if (!WIFEXITED(res) || WEXITSTATUS(res)) |
| 364 | #else |
| 365 | if (res) |
| 366 | #endif |
353 | 367 | VERBOSE(VB_IMPORTANT, "NativeArchive: Failed to clear work directory"); |
354 | 368 | } |
355 | 369 | |
… |
… |
static int grabThumbnail(QString inFile, QString thumbList, QString outFile, int |
1873 | 1887 | AVPacket pkt; |
1874 | 1888 | AVPicture orig; |
1875 | 1889 | 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)); |
1878 | 1892 | |
1879 | 1893 | int bufflen = width * height * 4; |
1880 | 1894 | unsigned char *outputbuf = new unsigned char[bufflen]; |
… |
… |
static int isRemote(QString filename) |
2438 | 2452 | if (!QFile::exists(filename)) |
2439 | 2453 | return 0; |
2440 | 2454 | |
| 2455 | #if CONFIG_DARWIN |
2441 | 2456 | struct statfs statbuf; |
2442 | | bzero(&statbuf, sizeof(statbuf)); |
| 2457 | std::memset(&statbuf, 0, sizeof(statbuf)); |
2443 | 2458 | |
2444 | | #if CONFIG_DARWIN |
2445 | 2459 | if ((statfs(qPrintable(filename), &statbuf) == 0) && |
2446 | 2460 | ((!strcmp(statbuf.f_fstypename, "nfs")) || // NFS|FTP |
2447 | 2461 | (!strcmp(statbuf.f_fstypename, "afpfs")) || // ApplShr |
2448 | 2462 | (!strcmp(statbuf.f_fstypename, "smbfs")))) // SMB |
2449 | 2463 | return 2; |
2450 | 2464 | #elif __linux__ |
| 2465 | struct statfs statbuf; |
| 2466 | std::memset(&statbuf, 0, sizeof(statbuf)); |
| 2467 | |
2451 | 2468 | if ((statfs(qPrintable(filename), &statbuf) == 0) && |
2452 | 2469 | ((statbuf.f_type == 0x6969) || // NFS |
2453 | 2470 | (statbuf.f_type == 0x517B))) // SMB |
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) |
275 | 275 | |
276 | 276 | static void xmkdir(const char * path, int mode) |
277 | 277 | { |
| 278 | #ifdef USING_MINGW |
| 279 | if (mkdir(path) < 0) |
| 280 | #else |
278 | 281 | if (mkdir(path, mode) < 0) |
| 282 | #endif |
279 | 283 | exc_throw(MiscError, "mkdir(%s, 0%o) failure:", path, mode); |
280 | 284 | } |
281 | 285 | |