]> granicus.if.org Git - transmission/commit
(trunk libT) #3975: "tr_bencToFile() contains unnecessary calls to stat() and unlink...
authorJordan Lee <jordan@transmissionbt.com>
Thu, 3 Feb 2011 00:48:05 +0000 (00:48 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Thu, 3 Feb 2011 00:48:05 +0000 (00:48 +0000)
commit3282e1ea815fb0c220d08d5c38564554b00e2b3e
tree163e75f621e851fc156bad6eab5b7ec7ea27ad23
parente8614030a290d0332bce1f933849bc1b8ea45e9d
(trunk libT) #3975: "tr_bencToFile() contains unnecessary calls to stat() and unlink()" -- fixed.

When saving a tr_benc object to disk at $dst, bencode.c saves it to a tmp file in the same directory as $dst, unlinks $dst if it exists, and then renames $tmp as $dst. This commit removes the middle step, which is unnecessary because rename() has guarantees about atomically overwriting $dst.
libtransmission/bencode.c