The 'args' array *must* be the last entry in the structure.
This fixes a longstanding issue (apparently since tc3) where
a service with an argument would corrupt the heap. The more
arguments, the more corruption :|. This will probably also end up
making key-code bound services more reliable (ie: bugreports triggered
via the keyboard)
Signed-off-by: San Mehat <san@google.com>
Merge commit 'b3779558dcfbe99f0b9c1ef796e3728edad25672'
* commit 'b3779558dcfbe99f0b9c1ef796e3728edad25672':
init: Fix some broken code that did not cause problems until switching to gcc 4.4
Merge commit '27808271934622e6473d7d664303fa3efb4cd662'
* commit '27808271934622e6473d7d664303fa3efb4cd662':
Make the /dev/qemu_trace device readable and writable by all.
Merge commit '770354d7e6cd471daed426fcf04bf7246e7cb18b'
* commit '770354d7e6cd471daed426fcf04bf7246e7cb18b':
init: Fix segfault when log_write() was missing an arg to format.
In keeping with the pattern of mtd@partition, I have added loop@path as a way to specify a loopback device. This way you can do things like mount directories in /system using cramfs from a file otherwise on /system (just one example oof how I'm using it). I specifically went with loop@ rather than adding this feature as a flag as the flags system is designed to set bits in the flags argument to mount: using loop@ fit the model in a much simpler manner and actually feels "correct".
This is a better version of the previously submitted 4045 that also refactors the mtd@ case. The reason for this is that I received comments that I should check for errors and return errors rather that do work in the case of success and fall through, but the mtd@ case wasn't doing that either and it became awkward to design the function so that it was half in one style of error handling and half in another. I also made certain to use inequality comparisons for Unix's -1 error returns rather than checking for -1, refactored my large if statement so as not to have danling parentheses, and disassocited the loop device on mount failure.