aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-12 13:08:22 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-12 13:08:22 +0100
commit424de06050ce295a5d1a3dbeb8d49e1735b4ffa1 (patch)
treedfa9a263be58e33d3e4ecfea8349563548ace0bf
parente038bcd47e69df8a612bc11928b9d0388aa6ac16 (diff)
downloadpaludis-424de06050ce295a5d1a3dbeb8d49e1735b4ffa1.tar.gz
paludis-424de06050ce295a5d1a3dbeb8d49e1735b4ffa1.tar.xz
Use std::rename from <cstdio>.
-rw-r--r--paludis/merger.cc7
-rw-r--r--paludis/util/fd_output_stream.hh3
-rw-r--r--paludis/util/fs_entry.cc3
3 files changed, 8 insertions, 5 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 460d167..65eda7a 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -35,6 +35,7 @@
#include <fcntl.h>
#include <errno.h>
#include <cstring>
+#include <cstdio>
#include <list>
#include <set>
#include <tr1/unordered_map>
@@ -741,7 +742,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
bool do_copy(false);
- if (0 == ::rename(stringify(src).c_str(), stringify(dst_real).c_str()))
+ if (0 == std::rename(stringify(src).c_str(), stringify(dst_real).c_str()))
{
result += msi_rename;
@@ -803,7 +804,7 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
if (-1 == count)
throw MergerError("read failed: " + stringify(::strerror(errno)));
- if (0 != ::rename(stringify(dst).c_str(), stringify(dst_real).c_str()))
+ if (0 != std::rename(stringify(dst).c_str(), stringify(dst_real).c_str()))
throw MergerError(
"rename(" + stringify(dst) + ", " + stringify(dst_real) + ") failed: " + stringify(::strerror(errno)));
@@ -942,7 +943,7 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
if (is_selinux_enabled())
relabel_dir_recursive(src, dst);
- if (0 == ::rename(stringify(src).c_str(), stringify(dst).c_str()))
+ if (0 == std::rename(stringify(src).c_str(), stringify(dst).c_str()))
{
result += msi_rename;
record_renamed_dir_recursive(dst);
diff --git a/paludis/util/fd_output_stream.hh b/paludis/util/fd_output_stream.hh
index 9d55966..15d0255 100644
--- a/paludis/util/fd_output_stream.hh
+++ b/paludis/util/fd_output_stream.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -22,6 +22,7 @@
#include <ostream>
#include <unistd.h>
+#include <cstdio>
/** \file
* Declarations for FDOutputStreamBuf.
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index ac9eec3..30ba051 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -41,6 +41,7 @@
#include <limits.h>
#include <cstring>
#include <cstdlib>
+#include <cstdio>
#include "config.h"
@@ -691,7 +692,7 @@ FSEntry::group() const
void
FSEntry::rename(const FSEntry & new_name)
{
- if (0 != ::rename(_imp->path.c_str(), new_name._imp->path.c_str()))
+ if (0 != std::rename(_imp->path.c_str(), new_name._imp->path.c_str()))
throw FSError("rename('" + stringify(_imp->path) + "', '" + stringify(new_name._imp->path) + "') failed: " +
::strerror(errno));
}