Bug 37812

Summary: if dbus-binding-tool fails, it leaves temporary files lying around
Product: dbus Reporter: Simon McVittie <smcv>
Component: GLibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: John (J5) Palmieri <johnp>
Severity: blocker    
Priority: medium CC: rob.taylor, will
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
URL: http://cgit.freedesktop.org/~smcv/dbus-glib/log/?h=clean-up-tmp-37812
Whiteboard: review?
i915 platform: i915 features:
Bug Depends on: 36428    
Bug Blocks:    
Attachments: dbus-binding-tool: clean up temporary file on error

Description Simon McVittie 2011-06-01 03:56:09 UTC
Created attachment 47417 [details] [review]
dbus-binding-tool: clean up temporary file on error

If dbus-binding-tool exits unsuccessfully, it leaves partial output in a file named after its output filename + ".tmp". This causes distcheck to fail in dbus-glib.

As written, this patch depends on the patches to remove vestigial i18n support (Bug #36428), since the alternative is conflict with them. It could be adapted if someone thinks we need to keep i18n support for some reason.

Because distcheck fails, this blocks a release of dbus-glib.
Comment 1 Will Thompson 2011-06-01 07:18:16 UTC
Review of attachment 47417 [details] [review]:

Looks fine, except …

::: dbus/dbus-glib-tool.c
@@ +478,3 @@
+    (void) g_remove (output_file_tmp);
+
+    (void) g_io_channel_shutdown (channel, FALSE, NULL);

Surely you should put this into the if (channel != NULL) {} block?
Comment 2 Simon McVittie 2011-06-02 05:12:12 UTC
Fixed in 0.94

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.