Ensure that output is world readable on Android

On Android, we need to be able to get access to the output
file remotely, so we make it world-readable.

Task-number: QTBUG-32079
Change-Id: I0a53a952d03339c0f1a1316f38bd206075589bde
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2013-07-29 15:32:34 +02:00 committed by The Qt Project
parent d05ce9c61e
commit c52bec9438

View File

@ -52,6 +52,10 @@
#include <unistd.h>
#endif
#ifdef Q_OS_ANDROID
#include <sys/stat.h>
#endif
QT_BEGIN_NAMESPACE
QAbstractTestLogger::QAbstractTestLogger(const char *filename)
@ -69,6 +73,12 @@ QAbstractTestLogger::QAbstractTestLogger(const char *filename)
fprintf(stderr, "Unable to open file for logging: %s\n", filename);
::exit(1);
}
#ifdef Q_OS_ANDROID
else {
// Make sure output is world-readable on Android
::chmod(filename, 0666);
}
#endif
}
QAbstractTestLogger::~QAbstractTestLogger()