Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH 2/4] netconfig: remove sysfs static functions
@ 2021-11-03 22:15 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2021-11-03 22:15 UTC (permalink / raw)
  To: iwd 

[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]

---
 src/netconfig.c | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/src/netconfig.c b/src/netconfig.c
index df9abd00..6e885546 100644
--- a/src/netconfig.c
+++ b/src/netconfig.c
@@ -50,6 +50,7 @@
 #include "src/util.h"
 #include "src/ie.h"
 #include "src/netconfig.h"
+#include "src/sysfs.h"
 
 struct netconfig {
 	uint32_t ifindex;
@@ -102,38 +103,6 @@ static void do_debug(const char *str, void *user_data)
 	l_info("%s%s", prefix, str);
 }
 
-static int write_string(const char *file, const char *value)
-{
-	size_t l = strlen(value);
-	int fd;
-	int r;
-
-	fd = L_TFR(open(file, O_WRONLY));
-	if (fd < 0)
-		return -errno;
-
-	r = L_TFR(write(fd, value, l));
-	L_TFR(close(fd));
-
-	return r;
-}
-
-static int sysfs_write_ipv6_setting(const char *ifname, const char *setting,
-					const char *value)
-{
-	int r;
-
-	L_AUTO_FREE_VAR(char *, file) =
-		l_strdup_printf("/proc/sys/net/ipv6/conf/%s/%s",
-							ifname, setting);
-
-	r = write_string(file, value);
-	if (r < 0)
-		l_error("Unable to write %s to %s", setting, file);
-
-	return r;
-}
-
 static void netconfig_free_settings(struct netconfig *netconfig)
 {
 	l_rtnl_address_free(netconfig->v4_address);
-- 
2.31.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-03 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-03 22:15 [PATCH 2/4] netconfig: remove sysfs static functions James Prestwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox