Add a comment about WriteOnly.
This commit is contained in:
parent
d92ebc0b76
commit
858f8d9bae
|
@ -137,6 +137,7 @@ bool ExternalCommandHelper::WriteFstab(const QByteArray& fileContents)
|
||||||
QString fstabPath = QStringLiteral("/etc/fstab");
|
QString fstabPath = QStringLiteral("/etc/fstab");
|
||||||
QFile fstabFile(fstabPath);
|
QFile fstabFile(fstabPath);
|
||||||
|
|
||||||
|
// WriteOnly implies O_TRUNC
|
||||||
auto flags = QIODevice::WriteOnly | QIODevice::Unbuffered;
|
auto flags = QIODevice::WriteOnly | QIODevice::Unbuffered;
|
||||||
if (!fstabFile.open(flags)) {
|
if (!fstabFile.open(flags)) {
|
||||||
qCritical() << xi18n("Could not open file <filename>%1</filename> for writing.", fstabPath);
|
qCritical() << xi18n("Could not open file <filename>%1</filename> for writing.", fstabPath);
|
||||||
|
|
Loading…
Reference in New Issue