case 0:
return ERR_OK;
+ case ERROR_READONLY:
+ case ERROR_WRITEONLY:
+ return ERR_INVOP;
+
case ERROR_DENIED:
return (nc->attr_error == ATTR_PASSWORD) ? ERR_BADPASS : ERR_DENIED;
}
-void extractSwitchAttributes (struct swi_attr *sa, const List *l)
+int extractSwitchAttributes (struct swi_attr *sa, const List *l)
{
const ListNode *ln;
const struct attr *at;
for (ln = l->first; ln != NULL; ln = ln->next) {
at = ln->data;
+ if (at->size == 0) {
+ if (at->attr == ATTR_NAME)
+ continue;
+ else
+ return -EMSGSIZE;
+ }
switch (at->attr) {
break;
case ATTR_END:
- return;
+ return 0;
}
}
+
+
+ return 0;
}