Date: Sun, 6 Mar 2016 04:38:08 +0000 (UTC) From: Kurt Lidl <lidl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296423 - head/lib/libc/db/db Message-ID: <201603060438.u264c8J6003681@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: lidl Date: Sun Mar 6 04:38:08 2016 New Revision: 296423 URL: https://svnweb.freebsd.org/changeset/base/296423 Log: Allow O_CLOEXEC to be used in dbopen() flags There is also a small portability crutch, also present in NetBSD, to allow compiling on a system that doesn't define O_CLOEXEC. Approved by: rpaulo (mentor) Obtained from: NetBSD (r1.17, r1.18) Differential Revision: https://reviews.freebsd.org/D5549 Modified: head/lib/libc/db/db/db.c Modified: head/lib/libc/db/db/db.c ============================================================================== --- head/lib/libc/db/db/db.c Sun Mar 6 04:13:17 2016 (r296422) +++ head/lib/libc/db/db/db.c Sun Mar 6 04:38:08 2016 (r296423) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); static int __dberr(void); +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + DB * dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo) { @@ -51,7 +55,7 @@ dbopen(const char *fname, int flags, int #define DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN) #define USE_OPEN_FLAGS \ (O_CREAT | O_EXCL | O_EXLOCK | O_NOFOLLOW | O_NONBLOCK | \ - O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC) + O_RDONLY | O_RDWR | O_SHLOCK | O_SYNC | O_TRUNC | O_CLOEXEC) if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0) switch (type) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603060438.u264c8J6003681>