Skip to content

Commit

Permalink
Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic ou…
Browse files Browse the repository at this point in the history
…t of

memory" and "no space left for DHCP options"
  • Loading branch information
Michael Brown committed Dec 20, 2006
1 parent 637a891 commit 4f50632
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/settings.c
Expand Up @@ -212,7 +212,7 @@ static int set_string ( struct config_context *context,
option = set_dhcp_option ( context->options, setting->tag,
value, strlen ( value ) );
if ( ! option )
return -ENOMEM;
return -ENOSPC;
return 0;
}

Expand Down Expand Up @@ -261,12 +261,12 @@ static int set_ipv4 ( struct config_context *context,
struct in_addr ipv4;
int rc;

if ( ( rc = inet_aton ( value, &ipv4 ) ) == 0 )
return rc;
if ( inet_aton ( value, &ipv4 ) == 0 )
return -EINVAL;
option = set_dhcp_option ( context->options, setting->tag,
&ipv4, sizeof ( ipv4 ) );
if ( ! option )
return -ENOMEM;
return -ENOSPC;
return 0;
}

Expand Down Expand Up @@ -330,7 +330,7 @@ static int set_int ( struct config_context *context,
option = set_dhcp_option ( context->options, setting->tag,
&u.bytes[ sizeof ( u ) - size ], size );
if ( ! option )
return -ENOMEM;
return -ENOSPC;
return 0;
}

Expand Down

0 comments on commit 4f50632

Please sign in to comment.