summaryrefslogtreecommitdiffstats
path: root/src/core/settings.c
diff options
context:
space:
mode:
authorMichael Brown2006-12-20 04:33:37 +0100
committerMichael Brown2006-12-20 04:33:37 +0100
commit4f506328ad93a3bbe54028f432d7db6e7ee25faa (patch)
treefcaec9af33e65395cca0b40ff248192a5e07e083 /src/core/settings.c
parentFix prototype of sleep() and move it to unistd.h (diff)
downloadipxe-4f506328ad93a3bbe54028f432d7db6e7ee25faa.tar.gz
ipxe-4f506328ad93a3bbe54028f432d7db6e7ee25faa.tar.xz
ipxe-4f506328ad93a3bbe54028f432d7db6e7ee25faa.zip
Use -ENOSPC rather than -ENOMEM, to distinguish the cases "generic out of
memory" and "no space left for DHCP options"
Diffstat (limited to 'src/core/settings.c')
-rw-r--r--src/core/settings.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/settings.c b/src/core/settings.c
index 3eface4b..22b1dafc 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -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;
}
@@ -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;
}
@@ -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;
}