From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 2/4] netconfig: remove sysfs static functions
Date: Wed, 03 Nov 2021 15:15:00 -0700 [thread overview]
Message-ID: <20211103221502.470442-2-prestwoj@gmail.com> (raw)
In-Reply-To: 20211103221502.470442-1-prestwoj@gmail.com
[-- 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
reply other threads:[~2021-11-03 22:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211103221502.470442-2-prestwoj@gmail.com \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.