欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

嵌入式 Linux 项目开发 (I) - BOA 移植 - IV.BOA 移植过程中的错误解决方案

最编程 2024-04-27 08:04:31
...

1gethostbyname:: No such file or directory

    解决办法: 修改boa.conf   去掉 ServerName www.your.org.here 前的注释符号(#)

2util.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

3boa.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

4boa.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

5log.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