[Merge] lp:~stgraber/ubuntu/raring/libnih/libnih-dbus-as-type into lp:ubuntu/libnih

Stéphane Graber stgraber at stgraber.org
Fri Dec 7 00:15:27 UTC 2012


Stéphane Graber has proposed merging lp:~stgraber/ubuntu/raring/libnih/libnih-dbus-as-type into lp:ubuntu/libnih.

Requested reviews:
  Stéphane Graber (stgraber)
  Upstart Reviewers (upstart-reviewers)
  James Hunt (jamesodhunt)

For more details, see:
https://code.launchpad.net/~stgraber/ubuntu/raring/libnih/libnih-dbus-as-type/+merge/138582

This change updates the dbus code generator for the outgoing 'as' type.

'as' is a null terminated string array, that ends up as 'char * const *'
as generated by nih-dbus-tool.

As it's NULL terminated, the current nih_assert (var != NULL); will trigger
whenever the function is passed an empty array.


This has become a problem in upstart where we now have a new EventEmitted
signal which has an "env" property that's the list of environment variables.
An empty event environment would trigger the assert causing upstart to fail.

The change I made is simply to detect variables of type 'char * const *' and
skip the code adding the nih_assert. I updated the two existing tests to match
that change.


Please note that I have no experience with libnih development at all and very
limited experience as one of its users, so this change may very well be wrong.
However in the limited test scenario that's my upstart branch, the change
appears to work as expected.
-- 
https://code.launchpad.net/~stgraber/ubuntu/raring/libnih/libnih-dbus-as-type/+merge/138582
Your team Upstart Reviewers is requested to review the proposed merge of lp:~stgraber/ubuntu/raring/libnih/libnih-dbus-as-type into lp:ubuntu/libnih.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: review-diff.txt
Type: text/x-diff
Size: 24150 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20121207/4cb331ef/attachment-0001.diff>


More information about the upstart-devel mailing list