嵌入式 Linux 项目开发 (I) - BOA 移植 - IV.BOA 移植过程中的错误解决方案
1、gethostbyname:: No such file or directory
解决办法: 修改boa.conf 去掉 ServerName www.your.org.here 前的注释符号(#)
2、util.c:100:1: error: pasting "t" and "->"does not give a valid preprocessing token make: *** [util.o]
解决办法:
修改 src/compat.h
#defineTIMEZONE_OFFSET(foo) foo##->tm_gmtoff
修改成
#defineTIMEZONE_OFFSET(foo) (foo)->tm_gmtoff
3、boa.c:211 - getpwuid: No such file or directory
解决办法: 修改src/boa.c
注释掉下面这段程序:
if (passwdbuf == NULL) {
DIE(”getpwuid”);
}
if(initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
DIE(”initgroups”);
}
即修改为:
#if 0
if (passwdbuf == NULL) {
DIE(”getpwuid”);
}
if(initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
DIE(”initgroups”);
}
#endif
4、boa.c:228 - icky Linux kernel bug!: No such file or directory
解决办法:
修改src/boa.c,注释掉下面语句:
if(setuid(0) != -1) {
DIE(”icky Linux kernel bug!”);
}
即修改为:
#if 0
if(setuid(0) != -1) {
DIE(”icky Linux kernel bug!”);
}
#endif
5、log.c:73 unable to dup2 the error log:bad file descriptor
解决方法:
修改src/log.c
注释掉
if(dup2(error_log, STDERR_FILENO) == -1) {
DIE("unableto dup2 the error log");
}
即修改为:
#if 0
if (dup2(error_log, STDERR_FILENO) == -1) {
DIE("unable to dup2 the error log");
}
#endif
6、执行boa程序报错not found
解决方法:
修改Makefile
LDFLAGS = -static