|
发表于 2004-3-2 09:48:19
|
显示全部楼层
在编译sqwebmail时出现错误,
- make[2]: Entering directory `/usr/local/src/sqwebmails/sqwebmail-3.5.0/bdbobj'
- Compiling bdbobj.c
- bdbobj.c: In function `bdbobj_open':
- bdbobj.c:117: warning: passing arg 2 of pointer to function from incompatible pointer type
- bdbobj.c:117: incompatible type for argument 4 of indirect function call
- bdbobj.c:117: too few arguments to function
- make[2]: *** [bdbobj.o] Error 1
- make[2]: Leaving directory `/usr/local/src/sqwebmails/sqwebmail-3.5.0/bdbobj'
- make[1]: *** [all] Error 2
- make[1]: Leaving directory `/usr/local/src/sqwebmails/sqwebmail-3.5.0/bdbobj'
- make: *** [all-recursive] Error 1
复制代码
请大侠帮忙看看是怎么会事。下面是提示出错的那一段:
- obj->dbf=0;
- if (db_create(&obj->dbf, NULL, 0) == 0)
- {
- if ( (*obj->dbf->open)(obj->dbf, filename, NULL,
- dbtype, flags, 0664))
- 117,1-8 35%
- (*obj->dbf->close)(obj->dbf, DB_NOSYNC);
- obj->dbf=0;
- }
- }
-
- if (obj->dbf)
复制代码
源函数如下:
- int bdbobj_open(struct bdbobj *obj, const char *filename, const char *modestr)
- {
- #if DB_VERSION_MAJOR < 2
-
- int flags=O_RDONLY;
-
- #else
-
- int flags=DB_RDONLY;
-
- #endif
-
- DBTYPE dbtype=DB_HASH;
-
- for ( ; *modestr; modestr++)
- switch (*modestr) {
- case 'c':
- case 'C':
- #if DB_VERSION_MAJOR < 2
- flags=O_RDWR|O_CREAT;
- #else
- flags=DB_CREATE;
- #endif
- break;
- case 'w':
- case 'W':
- #if DB_VERSION_MAJOR < 2
- flags=O_RDWR;
- #else
- flags=0;
- #endif
- break;
- 51,1 20%
- case 'n':
- case 'N':
- #if DB_VERSION_MAJOR < 2
- flags=O_RDWR|O_CREAT|O_TRUNC;
- #else
- flags=DB_CREATE|DB_TRUNCATE;
- #endif
-
- break;
-
- case 'b':
- case 'B':
- dbtype=DB_BTREE;
- break;
-
- case 'e':
- case 'E':
- dbtype=DB_RECNO;
- break;
- }
-
- bdbobj_close(obj);
-
- #if DB_VERSION_MAJOR < 3
- #if DB_VERSION_MAJOR < 2
- if ( (obj->dbf=dbopen(filename, flags, 0664, dbtype, 0)) != 0)
- #else
- if ( db_open(filename, dbtype, flags, 0664, 0, 0, &obj->dbf) == 0)
- #endif
- #else
- obj->dbf=0;
- if (db_create(&obj->dbf, NULL, 0) == 0)
- {
- if ( (*obj->dbf->open)(obj->dbf, filename, NULL,
- dbtype, flags, 0664))
- 117,1-8 35%
- (*obj->dbf->close)(obj->dbf, DB_NOSYNC);
- obj->dbf=0;
- }
- }
-
- if (obj->dbf)
- #endif
- {
- #ifdef FD_CLOEXEC
-
- #if DB_VERSION_MAJOR < 2
- int fd=(*obj->dbf->fd)(obj->dbf);
- #else
- int fd;
-
- if ((*obj->dbf->fd)(obj->dbf, &fd))
- fd= -1;
- #endif
-
- if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
- #endif
-
-
- obj->has_dbf=1;
- return (0);
- }
- return (-1);
- }
-
复制代码 |
|