Changeset 4e14ded in rtems-libbsd


Ignore:
Timestamp:
Oct 18, 2013, 1:52:13 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
43148f0
Parents:
9a3fa15
git-author:
Sebastian Huber <sebastian.huber@…> (10/18/13 13:52:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/31/13 12:18:49)
Message:

IFCONFIG(8): Workaround for struct option confict

Location:
freebsd/sbin/ifconfig
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sbin/ifconfig/af_inet6.c

    r9a3fa15 r4e14ded  
    532532        ip6lifetime++;  /* print IPv6 address lifetime */
    533533}
    534 #ifdef __rtems__
    535 static struct ifconfig_option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb };
    536 #else
    537534static struct option in6_Lopt = { .opt = "L", .opt_usage = "[-L]", .cb = in6_Lopt_cb };
    538 #endif
    539535
    540536static __constructor void
  • freebsd/sbin/ifconfig/ifclone.c

    r9a3fa15 r4e14ded  
    180180        exit(0);
    181181}
    182 #ifdef __rtems__
    183 static struct ifconfig_option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb };
    184 #else
    185182static struct option clone_Copt = { .opt = "C", .opt_usage = "[-C]", .cb = clone_Copt_cb };
    186 #endif
    187183
    188184static __constructor void
  • freebsd/sbin/ifconfig/ifconfig.c

    r9a3fa15 r4e14ded  
    4444#ifdef __rtems__
    4545#define __need_getopt_newlib
     46#define option getopt_option
    4647#include <getopt.h>
     48#undef option
    4749#endif /* __rtems__ */
    4850#include <rtems/bsd/sys/param.h>
     
    115117static void af_other_status(int);
    116118
    117 #ifdef __rtems__
    118 static struct ifconfig_option *opts = NULL;
     119static struct option *opts = NULL;
    119120
    120121void
    121 opt_register(struct ifconfig_option *p)
     122opt_register(struct option *p)
    122123{
    123124        p->next = opts;
    124125        opts = p;
    125126}
    126 #else
    127 static struct option *opts = NULL;
    128 
    129 void
    130 opt_register(struct option *p)
    131 {
    132         p->next = opts;
    133         opts = p;
    134 }
    135 #endif
    136127
    137128static void
     
    139130{
    140131        char options[1024];
    141         #ifdef __rtems__
    142         struct ifconfig_option *p;
    143         #else
    144132        struct option *p;
    145         #endif
    146133
    147134        /* XXX not right but close enough for now */
     
    191178        char options[1024], *cp;
    192179        const char *ifname;
    193 #ifdef __rtems__
    194         struct ifconfig_option *p;
    195 #else
    196180        struct option *p;
    197 #endif
    198181        size_t iflen;
    199182#ifdef __rtems__
  • freebsd/sbin/ifconfig/ifconfig.h

    r9a3fa15 r4e14ded  
    118118void    af_register(struct afswtch *);
    119119
    120 #ifdef __rtems__
    121 struct ifconfig_option {
    122 #else
    123120struct option {
    124 #endif
    125121        const char *opt;
    126122        const char *opt_usage;
    127123        void    (*cb)(const char *arg);
    128         #ifdef __rtems__
    129         struct ifconfig_option *next;
    130         #else
    131124        struct option *next;
    132         #endif
    133125};
    134 #ifdef __rtems__
    135 void    opt_register(struct ifconfig_option *);
    136 #else
    137126void    opt_register(struct option *);
    138 #endif
    139127
    140128extern  struct ifreq ifr;
  • freebsd/sbin/ifconfig/ifgroup.c

    r9a3fa15 r4e14ded  
    171171        .af_other_status = getifgroups,
    172172};
    173 #ifdef __rtems__
    174 static struct ifconfig_option group_gopt = { "g:", "[-g groupname]", printgroup };
    175 #else
    176173static struct option group_gopt = { "g:", "[-g groupname]", printgroup };
    177 #endif
    178174
    179175static __constructor void
Note: See TracChangeset for help on using the changeset viewer.