[rtems-net-legacy commit] rtems: Fix incorect header guard and white spaces
Chris Johns
chrisj at rtems.org
Fri Apr 14 20:18:24 UTC 2023
Module: rtems-net-legacy
Branch: main
Commit: d22fbcb0412e309850c0f49ab61bc410184b9b5c
Changeset: http://git.rtems.org/rtems-net-legacy/commit/?id=d22fbcb0412e309850c0f49ab61bc410184b9b5c
Author: Chris Johns <chrisj at rtems.org>
Date: Sat Apr 15 06:36:11 2023 +1000
rtems: Fix incorect header guard and white spaces
- Review changes from Gedare
---
include/rtems/rtems-net-legacy.h.in | 2 +-
rtems/rtems-bsd-iface.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/include/rtems/rtems-net-legacy.h.in b/include/rtems/rtems-net-legacy.h.in
index a17ec21..09592f1 100755
--- a/include/rtems/rtems-net-legacy.h.in
+++ b/include/rtems/rtems-net-legacy.h.in
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-#ifndef _RTEMS_NET_LGEACY_H_
+#ifndef _RTEMS_NET_LEGACY_H_
#define _RTEMS_NET_LEGACY_H_
#define RTEMS_NET_LEGACY_VERSION @RTEMS_NET_LEGACY_VERSION@
diff --git a/rtems/rtems-bsd-iface.c b/rtems/rtems-bsd-iface.c
index 0f6432f..8bd1536 100755
--- a/rtems/rtems-bsd-iface.c
+++ b/rtems/rtems-bsd-iface.c
@@ -114,7 +114,7 @@ int
rtems_bsd_iface_link_state(const char *name, bool *state)
{
struct rtems_bsd_iface iface;
- struct ifmediareq ifmr;
+ struct ifmediareq ifmr = {0};
int s;
int rc;
@@ -133,10 +133,9 @@ rtems_bsd_iface_link_state(const char *name, bool *state)
return -1;
}
- memset(&ifmr, 0, sizeof(ifmr));
- strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
+ strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
- rc = ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr);
+ rc = ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr);
close(s);
if (rc < 0) {
More information about the vc
mailing list