[Bug 42422] [libc] [patch] dbm_delete returns -1 instead of 1 when the key does not exist in the database.

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Feb 20 00:54:05 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=42422

Xin LI <delphij at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |delphij at FreeBSD.org
             Status|In Progress                 |Open

--- Comment #3 from Xin LI <delphij at FreeBSD.org> ---
(In reply to gclarkii from comment #0)
The proposed change is wrong, unfortunately.  It's the manual page that should
be corrected instead.  To quote POSIX [1]:

"
RETURN VALUE

The dbm_store() and dbm_delete() functions shall return 0 when they succeed and
a negative value when they fail.
"

So, we must return a negative value, and -1 is one of the valid return values. 
1 on the other hand is not.

I have also checked Solaris and GDBM's implementation of the same interface and
they all return -1.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/dbm_clearerr.html

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list