Handle errors on rename of target file.

[apenwarr: this is the remaining part after part of the original was
included in someone else's separate patch.]
This commit is contained in:
Alan Falloon 2014-05-01 21:23:22 -04:00 committed by Avery Pennarun
commit f4b4c400b2

View file

@ -261,7 +261,9 @@ class BuildJob:
if e.errno == errno.ENOENT:
unlink(t)
else:
raise
err('%s: can\'t save stdout to %r: %s\n' %
(self.argv[2], t, e.strerror))
rv = 1000
if st2:
os.unlink(self.tmpname2)
else: # no output generated at all; that's ok
@ -288,7 +290,7 @@ class BuildJob:
sf.save()
f.close()
if rv != 0:
err('%s: exit code %d\n' % (_nice(t),rv))
err('%s: exit code %r\n' % (_nice(t),rv))
else:
if vars.VERBOSE or vars.XTRACE or vars.DEBUG:
log('%s (done)\n\n' % _nice(t))