aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-24 13:30:24 +0000
committerRoy Marples <roy@marples.name>2008-03-24 13:30:24 +0000
commit0347f01345459a506d606002e6a0da29d8bcb77a (patch)
tree04d753ab3f061bb17ae7c00acc1229f326b07d4f
parent5a80daaf4318fedf38af2e2a0df1f5a67e3670b0 (diff)
Fix segfault when no coldplugged services, thanks to Daijo.
-rw-r--r--src/rc/rc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index ff8995b2..f5cd1dd7 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -632,8 +632,9 @@ static void do_coldplug(void)
/* Load our list of coldplugged services and display them */
einfon("Device initiated services:%s", ecolor(ECOLOR_HILITE));
coldplugged_services = rc_services_in_state(RC_SERVICE_COLDPLUGGED);
- TAILQ_FOREACH(s, coldplugged_services, entries)
- printf(" %s", s->value);
+ if (coldplugged_services)
+ TAILQ_FOREACH(s, coldplugged_services, entries)
+ printf(" %s", s->value);
printf ("%s\n", ecolor(ECOLOR_NORMAL));
}