]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
isc_file_renameunique() set its result incorrectly if renaming failed; it used
authorDavid Lawrence <source@isc.org>
Wed, 27 Dec 2000 17:21:53 +0000 (17:21 +0000)
committerDavid Lawrence <source@isc.org>
Wed, 27 Dec 2000 17:21:53 +0000 (17:21 +0000)
the value of errno from an unlink() call, not from the rename() call.

lib/isc/unix/file.c

index 0eb2f86036a6e18ddd51eceb265b9491ca6b547e..682ff3f04ff4cd5b28cda144639098e42b568d84 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: file.c,v 1.26 2000/10/20 22:09:01 gson Exp $ */
+/* $Id: file.c,v 1.27 2000/12/27 17:21:53 tale Exp $ */
 
 #include <config.h>
 
@@ -163,8 +163,8 @@ isc_file_renameunique(const char *file, char *templet) {
        if (result == ISC_R_SUCCESS) {
                res = rename(file, templet);
                if (res != 0) {
-                       (void)unlink(templet);
                        result = isc__errno2result(errno);
+                       (void)unlink(templet);
                }
        }
        if (fd != -1)