[lxc-devel] [PATCH] lxc_user_nic: remove duplicate code

Serge Hallyn serge.hallyn at ubuntu.com
Fri Nov 8 04:24:30 UTC 2013


Quoting Qiang Huang (h.huangqiang at huawei.com):
> It's a duplicate of util.h.
> 
> Signed-off-by: Qiang Huang <h.huangqiang at huawei.com>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

Yup, thanks.  Stéphane had already mentioned it.  I had put the
setns bit in there while trying to figure out why SYS_setns
was coming up undefined, and failed to remove it when this did
not fix it...

> ---
>  src/lxc/lxc_user_nic.c | 20 --------------------
>  1 file changed, 20 deletions(-)
> 
> diff --git a/src/lxc/lxc_user_nic.c b/src/lxc/lxc_user_nic.c
> index dc35e55..e4f59fa 100644
> --- a/src/lxc/lxc_user_nic.c
> +++ b/src/lxc/lxc_user_nic.c
> @@ -49,25 +49,6 @@
>  #include "config.h"
>  #include "utils.h"
> 
> -#ifndef HAVE_GETLINE
> -#ifdef HAVE_FGETLN
> -#include <../include/getline.h>
> -#endif
> -#endif
> -
> -/* Define setns() if missing from the C library */
> -#ifndef HAVE_SETNS
> -static inline int setns(int fd, int nstype)
> -{
> -#ifdef __NR_setns
> -	return syscall(__NR_setns, fd, nstype);
> -#else
> -	errno = ENOSYS;
> -	return -1;
> -#endif
> -}
> -#endif
> -
>  #if ISTEST
>  #define CONF_FILE "/tmp/lxc-usernet"
>  #define DB_FILE "/tmp/nics"
> @@ -76,7 +57,6 @@ static inline int setns(int fd, int nstype)
>  #define DB_FILE LXC_USERNIC_DB
>  #endif
> 
> -
>  #include "nl.h"
> 
>  #ifndef IFLA_LINKMODE
> -- 
> 1.8.3
> 




More information about the lxc-devel mailing list