createrepo_shared: Avoid double removal of the same directory by the failure_exit_cle...
authorTomas Mlcoch <tmlcoch@redhat.com>
Wed, 1 Apr 2015 10:59:09 +0000 (12:59 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Wed, 1 Apr 2015 10:59:09 +0000 (12:59 +0200)
src/createrepo_shared.c

index fc4a03d..ea389bf 100644 (file)
@@ -81,7 +81,10 @@ cr_set_cleanup_handler(const char *lock_dir,
 
     // Set global variables
     global_lock_dir     = g_strdup(lock_dir);
-    global_tmp_out_repo = g_strdup(tmp_out_repo);
+    if (g_strcmp0(lock_dir, tmp_out_repo))
+        global_tmp_out_repo = g_strdup(tmp_out_repo);
+    else
+        global_tmp_out_repo = NULL;
 
     // Register on exit cleanup function
     if (on_exit(failure_exit_cleanup, NULL))