summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengwei Yang <chengwei.yang@intel.com>2013-12-01 19:40:21 +0800
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-01-06 15:45:22 +0000
commit653790c9858180baf4259b38c7c9d5196e39114b (patch)
treeb0978e64e90473a13eaa39efcafe0d191d96bcd9
parent2d950f6e9a412da70e9f8bc956980abc949a5fe8 (diff)
downloaddbus-653790c9858180baf4259b38c7c9d5196e39114b.tar.gz
kqueue: replace tab with space
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69332 [altered commit message to not say it fixes memory leaks -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--bus/dir-watch-kqueue.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/bus/dir-watch-kqueue.c b/bus/dir-watch-kqueue.c
index c60560f0..065fabb3 100644
--- a/bus/dir-watch-kqueue.c
+++ b/bus/dir-watch-kqueue.c
@@ -73,12 +73,12 @@ _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
{
kq = -1;
if (watch != NULL)
- {
- _dbus_loop_remove_watch (loop, watch);
+ {
+ _dbus_loop_remove_watch (loop, watch);
_dbus_watch_invalidate (watch);
_dbus_watch_unref (watch);
- watch = NULL;
- }
+ watch = NULL;
+ }
pid = getpid ();
_dbus_verbose ("Sending SIGHUP signal since kqueue has been closed\n");
(void) kill (pid, SIGHUP);
@@ -99,32 +99,32 @@ _init_kqueue (BusContext *context)
if (kq < 0)
{
_dbus_warn ("Cannot create kqueue; error '%s'\n", _dbus_strerror (errno));
- goto out;
- }
-
- loop = bus_context_get_loop (context);
-
- watch = _dbus_watch_new (kq, DBUS_WATCH_READABLE, TRUE,
- _handle_kqueue_watch, NULL, NULL);
-
- if (watch == NULL)
- {
- _dbus_warn ("Unable to create kqueue watch\n");
- close (kq);
- kq = -1;
- goto out;
- }
-
- if (!_dbus_loop_add_watch (loop, watch))
- {
- _dbus_warn ("Unable to add reload watch to main loop");
- _dbus_watch_invalidate (watch);
- _dbus_watch_unref (watch);
- watch = NULL;
- close (kq);
- kq = -1;
- goto out;
- }
+ goto out;
+ }
+
+ loop = bus_context_get_loop (context);
+
+ watch = _dbus_watch_new (kq, DBUS_WATCH_READABLE, TRUE,
+ _handle_kqueue_watch, NULL, NULL);
+
+ if (watch == NULL)
+ {
+ _dbus_warn ("Unable to create kqueue watch\n");
+ close (kq);
+ kq = -1;
+ goto out;
+ }
+
+ if (!_dbus_loop_add_watch (loop, watch))
+ {
+ _dbus_warn ("Unable to add reload watch to main loop");
+ _dbus_watch_invalidate (watch);
+ _dbus_watch_unref (watch);
+ watch = NULL;
+ close (kq);
+ kq = -1;
+ goto out;
+ }
}
ret = 1;
@@ -169,12 +169,12 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
if (dirs[j] && strcmp (new_dirs[i], dirs[j]) == 0)
{
new_fds[i] = fds[j];
- new_dirs[i] = dirs[j];
- fds[j] = -1;
- dirs[j] = NULL;
- break;
- }
- }
+ new_dirs[i] = dirs[j];
+ fds[j] = -1;
+ dirs[j] = NULL;
+ break;
+ }
+ }
}
/* Any directory we find in "fds" with a nonzero fd must
@@ -185,10 +185,10 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
if (fds[j] != -1)
{
close (fds[j]);
- dbus_free (dirs[j]);
- fds[j] = -1;
- dirs[j] = NULL;
- }
+ dbus_free (dirs[j]);
+ fds[j] = -1;
+ dirs[j] = NULL;
+ }
}
for (i = 0; new_dirs[i]; i++)
@@ -196,8 +196,8 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
if (new_fds[i] == -1)
{
/* FIXME - less lame error handling for failing to add a watch;
- * we may need to sleep.
- */
+ * we may need to sleep.
+ */
fd = open (new_dirs[i], O_RDONLY);
if (fd < 0)
{
@@ -223,18 +223,18 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories)
goto out;
}
- new_fds[i] = fd;
- new_dirs[i] = _dbus_strdup (new_dirs[i]);
- if (!new_dirs[i])
+ new_fds[i] = fd;
+ new_dirs[i] = _dbus_strdup (new_dirs[i]);
+ if (!new_dirs[i])
{
/* FIXME have less lame handling for OOM, we just silently fail to
- * watch. (In reality though, the whole OOM handling in dbus is
- * stupid but we won't go into that in this comment =) )
- */
+ * watch. (In reality though, the whole OOM handling in dbus is
+ * stupid but we won't go into that in this comment =) )
+ */
close (fd);
- new_fds[i] = -1;
- }
- }
+ new_fds[i] = -1;
+ }
+ }
}
num_fds = i;