Commit 260d516d authored by Brenden Blanco's avatar Brenden Blanco

Cleanups for some build/compile failures

* Change ftw to nftw, and do depth-first tmpdir cleanup
* Scrub CROSS_COMPILE variable before kbuild_helpers
Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
parent c989d1ab
...@@ -52,7 +52,7 @@ int KBuildHelper::learn_flags(const string &tmpdir, const char *uname_release, c ...@@ -52,7 +52,7 @@ int KBuildHelper::learn_flags(const string &tmpdir, const char *uname_release, c
if (!cf) if (!cf)
return -1; return -1;
} }
string cmd = "make -s"; string cmd = "make CROSS_COMPILE= -s";
cmd += " -C " KERNEL_MODULES_DIR "/" + string(uname_release) + "/build"; cmd += " -C " KERNEL_MODULES_DIR "/" + string(uname_release) + "/build";
cmd += " M=" + tmpdir + " dummy.o"; cmd += " M=" + tmpdir + " dummy.o";
int rc = ::system(cmd.c_str()); int rc = ::system(cmd.c_str());
......
...@@ -57,7 +57,7 @@ class DirStack { ...@@ -57,7 +57,7 @@ class DirStack {
char cwd_[256]; char cwd_[256];
}; };
static int ftw_cb(const char *path, const struct stat *, int) { static int ftw_cb(const char *path, const struct stat *, int, struct FTW *) {
return ::remove(path); return ::remove(path);
} }
...@@ -73,7 +73,7 @@ class TmpDir { ...@@ -73,7 +73,7 @@ class TmpDir {
ok_ = true; ok_ = true;
} }
~TmpDir() { ~TmpDir() {
if (::ftw(prefix_.c_str(), ftw_cb, 20) < 0) if (::nftw(prefix_.c_str(), ftw_cb, 20, FTW_DEPTH) < 0)
::perror("ftw"); ::perror("ftw");
else else
::remove(prefix_.c_str()); ::remove(prefix_.c_str());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment