waf: always close cross answers file
authorUri Simchoni <urisimchoni@gmail.com>
Mon, 18 May 2015 17:40:11 +0000 (20:40 +0300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 May 2015 09:19:11 +0000 (11:19 +0200)
When configuring samba for cross-compilation using the
cross-answers file, the file is not closed in a couple of
cases - fix that.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
buildtools/wafsamba/samba_cross.py

index 3838e34ec48244d093e48c17f5ebdc2d302f45f4..877ead8581528695aa1062296186156121eb8151 100644 (file)
@@ -58,8 +58,10 @@ def cross_answer(ca_file, msg):
                 f.close()
                 return ANSWER_FAIL
             elif ans[0] == '"':
+                f.close()
                 return (0, ans.strip('"'))
             elif ans[0] == "'":
+                f.close()
                 return (0, ans.strip("'"))
             else:
                 m = re.match('\(\s*(-?\d+)\s*,\s*\"(.*)\"\s*\)', ans)