Log an error if property pool is exhausted

Failing to set properties due to an exhausted pool leads
to difficult to debug problems. This change adds an
error log to make the situation a bit easier to handle.

Change-Id: Icc1d97a80882fb23e74428a0195f1d28dba68fa8
This commit is contained in:
Johan Redestig 2013-04-29 09:11:57 +02:00
parent 5ea5854315
commit fd7ffb1089

View file

@ -353,7 +353,11 @@ int property_set(const char *name, const char *value)
__futex_wake(&pa->serial, INT32_MAX);
} else {
pa = __system_property_area__;
if(pa->count == PA_COUNT_MAX) return -1;
if(pa->count == PA_COUNT_MAX) {
ERROR("Failed to set '%s'='%s', property pool is exhausted at %d entries",
name, value, PA_COUNT_MAX);
return -1;
}
pi = pa_info_array + pa->count;
pi->serial = (valuelen << 24);