aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-12-27 03:10:16 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-12-27 03:10:16 (GMT)
commit9f65889534279731f4b00af243c1edc885eece09 (patch)
tree66b14315c3e92dcc98ecab5b46ac57c07d337ae0
parentEventLoop: thread-safe idle_add and timeout_add (diff)
downloadportage-9f65889534279731f4b00af243c1edc885eece09.zip
portage-9f65889534279731f4b00af243c1edc885eece09.tar.gz
portage-9f65889534279731f4b00af243c1edc885eece09.tar.bz2
merge-sync: handle PyPy syncfs fail, bug #446610
-rw-r--r--pym/portage/dbapi/vartree.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 25128bf..840e796 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -4731,15 +4731,10 @@ class dblink(object):
"merge-sync" not in self.settings.features:
return
+ syncfs_failed = False
syncfs = _get_syncfs()
- if syncfs is None:
- try:
- proc = subprocess.Popen(["sync"])
- except EnvironmentError:
- pass
- else:
- proc.wait()
- else:
+
+ if syncfs is not None:
for path in self._device_path_map.values():
if path is False:
continue
@@ -4749,12 +4744,22 @@ class dblink(object):
pass
else:
try:
- syncfs(fd)
+ if syncfs(fd) != 0:
+ # Happens with PyPy (bug #446610)
+ syncfs_failed = True
except OSError:
pass
finally:
os.close(fd)
+ if syncfs is None or syncfs_failed:
+ try:
+ proc = subprocess.Popen(["sync"])
+ except EnvironmentError:
+ pass
+ else:
+ proc.wait()
+
def merge(self, mergeroot, inforoot, myroot=None, myebuild=None, cleanup=0,
mydbapi=None, prev_mtimes=None, counter=None):
"""