代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libdb 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff -up db-5.3.28/src/dbinc_auto/int_def.in.rpmlock db-5.3.28/src/dbinc_auto/int_def.in
--- db-5.3.28/src/dbinc_auto/int_def.in.rpmlock 2017-06-26 15:09:17.883356255 +0200
+++ db-5.3.28/src/dbinc_auto/int_def.in 2017-06-26 15:09:27.421170401 +0200
@@ -1573,6 +1573,7 @@
#define __os_posix_err __os_posix_err@DB_VERSION_UNIQUE_NAME@
#define __os_fileid __os_fileid@DB_VERSION_UNIQUE_NAME@
#define __check_lock_fn __check_lock_fn@DB_VERSION_UNIQUE_NAME@
+#define __rpm_lock_free __rpm_lock_free@DB_VERSION_UNIQUE_NAME@
#define __os_fdlock __os_fdlock@DB_VERSION_UNIQUE_NAME@
#define __os_fsync __os_fsync@DB_VERSION_UNIQUE_NAME@
#define __os_getenv __os_getenv@DB_VERSION_UNIQUE_NAME@
diff -up db-5.3.28/src/dbinc_auto/os_ext.h.rpmlock db-5.3.28/src/dbinc_auto/os_ext.h
--- db-5.3.28/src/dbinc_auto/os_ext.h.rpmlock 2017-06-26 15:09:21.940277203 +0200
+++ db-5.3.28/src/dbinc_auto/os_ext.h 2017-06-26 15:09:27.354171707 +0200
@@ -42,6 +42,7 @@ char *__os_strerror __P((int, char *, si
int __os_posix_err __P((int));
int __os_fileid __P((ENV *, const char *, int, u_int8_t *));
int __check_lock_fn __P((char *, pid_t));
+int __rpm_lock_free __P((ENV *));
int __os_fdlock __P((ENV *, DB_FH *, off_t, db_lockmode_t, int));
int __os_fsync __P((ENV *, DB_FH *));
int __os_getenv __P((ENV *, const char *, char **, size_t));
diff -up db-5.3.28/src/env/env_region.c.rpmlock db-5.3.28/src/env/env_region.c
--- db-5.3.28/src/env/env_region.c.rpmlock 2017-06-26 15:09:12.479461558 +0200
+++ db-5.3.28/src/env/env_region.c 2017-06-26 15:09:12.481461519 +0200
@@ -291,18 +291,23 @@ user_map_functions:
if (create_ok &&
ret == DB_OLD_VERSION &&
ENV_PRIMARY_LOCK(env, DB_LOCK_WRITE, 1) == 0) {
- if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY))
- __db_msg(env, "Recreating idle environment");
- F_SET(infop, REGION_CREATE_OK);
+ /* If the rpm transaction lock is taken we cannot safely rebuild */
+ if (!__rpm_lock_free(env))
+ ENV_PRIMARY_UNLOCK(env);
+ else {
+ if (FLD_ISSET(dbenv->verbose, DB_VERB_RECOVERY))
+ __db_msg(env, "Recreating idle environment");
+ F_SET(infop, REGION_CREATE_OK);
- /*
- * Detach from the environment region; we need to unmap it (and
- * close any file handle) so that we don't leak memory or files.
- */
- DB_ASSERT(env, infop->rp == NULL);
- infop->rp = &tregion;
- (void)__env_sys_detach(env, infop, 0);
- goto creation;
+ /*
+ * Detach from the environment region; we need to unmap it (and
+ * close any file handle) so that we don't leak memory or files.
+ */
+ DB_ASSERT(env, infop->rp == NULL);
+ infop->rp = &tregion;
+ (void)__env_sys_detach(env, infop, 0);
+ goto creation;
+ }
}
if (renv->majver != DB_VERSION_MAJOR ||
diff -up db-5.3.28/src/os/os_flock.c.rpmlock db-5.3.28/src/os/os_flock.c
--- db-5.3.28/src/os/os_flock.c.rpmlock 2017-06-26 15:09:12.480461538 +0200
+++ db-5.3.28/src/os/os_flock.c 2017-06-26 15:09:12.481461519 +0200
@@ -79,6 +79,35 @@ int __check_lock_fn(fn, pid)
}
/*
+ * __rpm_lock_free --
+ * Try to look at a lock used by rpm to see if libdb is being
+ * updated and it is safe to access its environment files.
+ * PUBLIC: int __rpm_lock_free __P((ENV *));
+ */
+
+#define RPM_PATH SHAREDSTATEDIR "/rpm"
+#define RPMLOCK_PATH RPM_PATH "/.rpm.lock"
+
+int __rpm_lock_free(env)
+ ENV *env;
+{
+ int ret;
+
+ /* No need to check the transaction lock if not in rpm */
+ if (strstr(env->db_home, RPM_PATH) == NULL)
+ return 1;
+
+ /* Assume it is safe to rebuild if the lock file does not exist */
+ if (access(RPMLOCK_PATH, F_OK) && errno == ENOENT)
+ return 1;
+
+ ret = __check_lock_fn(RPMLOCK_PATH, 0);
+ /* __check_lock_fn can return -1 on failure - return 0 (taken) instead */
+ return ret == -1 ? 0: ret;
+
+}
+
+/*
* __os_fdlock --
* Acquire/release a lock on a byte in a file.
*
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。