From 72f919c42a7b327b92b03206662ba3accad31bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Thu, 3 Jan 2013 12:24:20 -0500 Subject: [PATCH] conf.c: Cleanup __S_ISTYPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __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 Acked-by: Serge E. Hallyn --- 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 062434f92..eb4f8bd23 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -166,6 +166,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" }; @@ -590,7 +595,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");