diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-29 20:13:44 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-04 17:30:07 +0000 |
commit | a06fb55dcb0820e078588c6a6d96c74b712dd380 (patch) | |
tree | 1548b642c4669d3cf44a53770d693ce064499dce /src/corelib/io/qtemporaryfile.cpp | |
parent | 3d6cbe3409d52e5ca63b8d04261b8fd531d89c98 (diff) |
QFile::rename: use QTemporaryFileName instead of QTemporaryFile
This means the workaround for Linux's behavior now works even if
QTemporaryFile is disabled. We also avoid the creation of an otherwise
unused temporary file just so we can take its name.
Tested with tests/manual/filetest. Strace shows:
renameat2(AT_FDCWD, "a", AT_FDCWD, "/var/run/media/tjmaciei/B852-6088/a.EBG705", RENAME_NOREPLACE) = 0
renameat2(AT_FDCWD, "/var/run/media/tjmaciei/B852-6088/a.EBG705", AT_FDCWD, "A", RENAME_NOREPLACE) = 0
Before it was:
open("/var/run/media/tjmaciei/B852-6088/a.VuL412", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = 4
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
lseek(4, 0, SEEK_SET) = 0
rename("a", "/var/run/media/tjmaciei/B852-6088/a.VuL412") = 0
stat("A", 0x7fff13260f00) = -1 ENOENT (No such file or directory)
close(4) = 0
renameat2(AT_FDCWD, "/var/run/media/tjmaciei/B852-6088/a.VuL412", AT_FDCWD, "A", RENAME_NOREPLACE) = 0
(the absolute path comes from fd61059d359f0bee1c37d6bf08bf4b83381658ca
and it seems it was needed for Symbian)
Change-Id: I1eba2b016de74620bfc8fffd14ccc7c4ded009c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qtemporaryfile.cpp')
0 files changed, 0 insertions, 0 deletions