cleanups; use sys_clone()
[util-vserver.git] / util-vserver / src / vunify-doit.hc
index ba9b054..c49d720 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#include "wrappers-io.h"
-
 #include <sys/types.h>
 #include <utime.h>
+#include <fcntl.h>
 
 static bool
 doitUnify(char const *src, struct stat const *src_stat,
@@ -31,7 +30,8 @@ doitUnify(char const *src, struct stat const *src_stat,
 
   // at first, set the ILI flags on 'src'
   if (vc_set_iattr_compat(src, src_stat->st_dev, src_stat->st_ino,
-                         0, VC_IATTR_IUNLINK, VC_IATTR_IUNLINK)==-1)
+                         0, VC_IATTR_IUNLINK, VC_IATTR_IUNLINK,
+                         &src_stat->st_mode)==-1)
     return false;
 
   // now, create a temporary filename