1 Star 0 Fork 17

openeuler-embedded/libdb

forked from src-openEuler/libdb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
db-1.85-errno.patch 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
dogsheng 提交于 2019-11-19 14:17 . Package init
glibc doesn't like errno as the name of a field.
--- db.1.85/hash/hash.h Mon Feb 18 19:12:14 2002
+++ db.1.85/hash/hash.h Mon Feb 18 19:12:20 2002
@@ -103,7 +103,7 @@
BUFHEAD *cpage; /* Current page */
int cbucket; /* Current bucket */
int cndx; /* Index of next item on cpage */
- int errno; /* Error Number -- for DBM
+ int err; /* Error Number -- for DBM
* compatability */
int new_file; /* Indicates if fd is backing store
* or no */
--- db.1.85/hash/hash.c Mon Feb 18 19:12:24 2002
+++ db.1.85/hash/hash.c Mon Feb 18 19:12:44 2002
@@ -505,7 +505,7 @@
else
if (wsize != sizeof(HASHHDR)) {
errno = EFTYPE;
- hashp->errno = errno;
+ hashp->err = errno;
return (-1);
}
for (i = 0; i < NCACHED; i++)
@@ -536,7 +536,7 @@
hashp = (HTAB *)dbp->internal;
if (flag) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
return (hash_access(hashp, HASH_GET, (DBT *)key, data));
@@ -553,11 +553,11 @@
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_NOOVERWRITE) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
- hashp->errno = errno = EPERM;
+ hashp->err = errno = EPERM;
return (ERROR);
}
return (hash_access(hashp, flag == R_NOOVERWRITE ?
@@ -574,11 +574,11 @@
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_CURSOR) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
if ((hashp->flags & O_ACCMODE) == O_RDONLY) {
- hashp->errno = errno = EPERM;
+ hashp->err = errno = EPERM;
return (ERROR);
}
return (hash_access(hashp, HASH_DELETE, (DBT *)key, NULL));
@@ -729,7 +729,7 @@
hashp = (HTAB *)dbp->internal;
if (flag && flag != R_FIRST && flag != R_NEXT) {
- hashp->errno = errno = EINVAL;
+ hashp->err = errno = EINVAL;
return (ERROR);
}
#ifdef HASH_STATISTICS
--- db.1.85/hash/ndbm.c Mon Feb 18 19:12:58 2002
+++ db.1.85/hash/ndbm.c Mon Feb 18 19:13:05 2002
@@ -180,7 +180,7 @@
HTAB *hp;
hp = (HTAB *)db->internal;
- return (hp->errno);
+ return (hp->err);
}
extern int
@@ -190,7 +190,7 @@
HTAB *hp;
hp = (HTAB *)db->internal;
- hp->errno = 0;
+ hp->err = 0;
return (0);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openeuler-embedded/libdb.git
git@gitee.com:openeuler-embedded/libdb.git
openeuler-embedded
libdb
libdb
openEuler-embedded

搜索帮助