mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 20:21:19 +08:00
Fix dhcpcd.conf content
Do not write '\0' characters to the file. This confuses the options parser.
This commit is contained in:
@@ -141,14 +141,14 @@ default_network_dhcpcd(void)
|
|||||||
S_IRWXU | S_IRWXG | S_IRWXO);
|
S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
assert(fd >= 0);
|
assert(fd >= 0);
|
||||||
|
|
||||||
n = write(fd, default_cfg, sizeof(default_cfg));
|
n = write(fd, default_cfg, sizeof(default_cfg) - 1);
|
||||||
assert(n == (ssize_t) sizeof(default_cfg));
|
assert(n == (ssize_t) sizeof(default_cfg) - 1);
|
||||||
|
|
||||||
#ifdef DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
|
#ifdef DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
|
||||||
static const char nodhcp_cfg[] = "nodhcp\nnodhcp6\n";
|
static const char nodhcp_cfg[] = "nodhcp\nnodhcp6\n";
|
||||||
|
|
||||||
n = write(fd, nodhcp_cfg, sizeof(nodhcp_cfg));
|
n = write(fd, nodhcp_cfg, sizeof(nodhcp_cfg) - 1);
|
||||||
assert(n == (ssize_t) sizeof(nodhcp_cfg));
|
assert(n == (ssize_t) sizeof(nodhcp_cfg) - 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rv = close(fd);
|
rv = close(fd);
|
||||||
|
Reference in New Issue
Block a user