summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2000-08-08 05:20:57 +0000
committergreen <green@FreeBSD.org>2000-08-08 05:20:57 +0000
commit18a0d975369707cba8c9deeb3de4db05dafb9487 (patch)
tree72678a56e7ee4e9cc63e23fdb6956b36c96b2381 /lib
parent2a86f209a7b5bcce77f89bd98d34a760ce42d2c9 (diff)
downloadFreeBSD-src-18a0d975369707cba8c9deeb3de4db05dafb9487.zip
FreeBSD-src-18a0d975369707cba8c9deeb3de4db05dafb9487.tar.gz
If using a DB_RECNO, db::put should return the new key if R_IAFTER is
set, not the previous key. Add $FreeBSD$, not taking this off the vendor branch because it's not on.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/recno/rec_put.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libc/db/recno/rec_put.c b/lib/libc/db/recno/rec_put.c
index 0a5bddf..69220a5 100644
--- a/lib/libc/db/recno/rec_put.c
+++ b/lib/libc/db/recno/rec_put.c
@@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -167,8 +169,14 @@ einval: errno = EINVAL;
if ((status = __rec_iput(t, nrec - 1, &fdata, flags)) != RET_SUCCESS)
return (status);
- if (flags == R_SETCURSOR)
+ switch (flags) {
+ case R_IAFTER:
+ nrec++;
+ break;
+ case R_SETCURSOR:
t->bt_cursor.rcursor = nrec;
+ break;
+ }
F_SET(t, R_MODIFIED);
return (__rec_ret(t, NULL, nrec, key, NULL));
OpenPOWER on IntegriCloud