xenstore: set correct error code when violating quota

When the number of permitted xenstore entries for a domain is being
exceeded the operation trying to create a new entry is denied.
Unfortunately errno isn't being set in this case so the error code
returned to the client is undefined.

Set errno to ENOSPC in this case.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Juergen Gross authored and Wei Liu committed 2017-03-22 11:23:10 +00:00
1 parent 5047677108
commit ec4abec209
1 file changed
+3 -1
+3 -1
View File
@@ -937,8 +937,10 @@ static struct node *construct_node(struct connection *conn, const void *ctx,
if (!parent)
return NULL;
if (domain_entry(conn) >= quota_nb_entry_per_domain)
if (domain_entry(conn) >= quota_nb_entry_per_domain) {
errno = ENOSPC;
return NULL;
}
/* Add child to parent. */
base = basename(name);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.