aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-20 21:35:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-21 21:47:26 +0000
commit1bc8f394387bb400c192bb9277e1d6a87b23e72d (patch)
treed2379c01cce3d9d91587637485738509802f4440
parente66b9782b45884502b69b0f2519fa7a9dd80917a (diff)
downloadpaludis-1bc8f394387bb400c192bb9277e1d6a87b23e72d.tar.gz
paludis-1bc8f394387bb400c192bb9277e1d6a87b23e72d.tar.xz
Check fchown return code
-rw-r--r--paludis/merger.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 9ec76ac..0932b74 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
* Copyright (c) 2008 Fernando J. Pereda
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -968,7 +968,9 @@ Merger::install_dir(const FSEntry & src, const FSEntry & dst_dir)
if ( !S_ISDIR(sb.st_mode))
throw MergerError("The directory that we just created is not a directory anymore");
if (! _imp->params.no_chown())
- ::fchown(dst_fd, src.owner(), src.group());
+ if (-1 == ::fchown(dst_fd, src.owner(), src.group()))
+ throw MergerError("Could not fchown the directory '" + stringify(dst) + "' that we just created: "
+ + stringify(::strerror(errno)));
/* pick up set*id bits */
::fchmod(dst_fd, mode);
try_to_copy_xattrs(src, dst_fd, result);