diff options
author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-09 19:48:39 +0000 |
---|---|---|
committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-05-09 19:48:39 +0000 |
commit | e8db465169591d3f77056294699c30113fe5206a (patch) | |
tree | 8e5a6660fe8ae81a32fc511b7c6e7592bf5018e0 /input/device.c | |
parent | 9e824dd2ce0e935616074a7242eab1a57fa8b86f (diff) |
input: small code cleanup
Diffstat (limited to 'input/device.c')
-rw-r--r-- | input/device.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/input/device.c b/input/device.c index 7067133e..75c64621 100644 --- a/input/device.c +++ b/input/device.c @@ -1003,7 +1003,7 @@ int input_device_register(DBusConnection *conn, bdaddr_t *src, bdaddr_t *dst, err = register_path(conn, path, idev); - if (*ppath) + if (!err && *ppath) *ppath = path; return err; @@ -1014,6 +1014,7 @@ int fake_input_register(DBusConnection *conn, bdaddr_t *src, { struct device *idev; const char *path; + int err; idev = device_new(src, dst); path = create_input_path(idev->major, idev->minor); @@ -1021,13 +1022,12 @@ int fake_input_register(DBusConnection *conn, bdaddr_t *src, idev->fake = g_new0(struct fake_input, 1); idev->fake->ch = ch; - if (register_path(conn, path, idev) < 0) - return -1; + err = register_path(conn, path, idev); - if (*ppath) + if (!err && *ppath) *ppath = path; - return 0; + return err; } int input_device_unregister(DBusConnection *conn, const char *path) |