[lxc-devel] [PATCH 19/21] conf.c: Cleanup __S_ISTYPE

Serge Hallyn serge.hallyn at canonical.com
Thu Jan 3 22:16:28 UTC 2013


Quoting Stéphane Graber (stgraber at ubuntu.com):
> __S_ISTYPE doesn't exist in all C libraries, so define it if it's missing.
> Additionaly, replace one occurence where it wasn't actually needed.
> 
> Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>

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

> ---
>  src/lxc/conf.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index 21a5cbb..5c58f0a 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -168,6 +168,11 @@ return -1;
>  }
>  #endif
>  
> +/* Define __S_ISTYPE if missing from the C library */
> +#ifndef __S_ISTYPE
> +#define        __S_ISTYPE(mode, mask)  (((mode) & S_IFMT) == (mask))
> +#endif
> +
>  char *lxchook_names[NUM_LXC_HOOKS] = {
>  	"pre-start", "pre-mount", "mount", "start", "post-stop" };
>  
> @@ -592,7 +597,7 @@ int pin_rootfs(const char *rootfs)
>  		return -1;
>  	}
>  
> -	if (!__S_ISTYPE(s.st_mode, S_IFDIR))
> +	if (!S_ISDIR(s.st_mode))
>  		return -2;
>  
>  	ret = snprintf(absrootfspin, MAXPATHLEN, "%s%s", absrootfs, ".hold");
> -- 
> 1.8.0
> 
> 
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list