]> git.ozlabs.org Git - ccan/commit
strmap: set errno to ENOENT even if we return NULL.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Nov 2011 23:05:29 +0000 (09:35 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Nov 2011 23:05:29 +0000 (09:35 +1030)
commit8bb0697b44f0dc4168f72ee621a291d68fefd4ad
tree6e66395e5a69f20b27245b4fc0f97a7ed178257c
parent13911ef769824a0958e1f1ce7292dfc8f23feb18
strmap: set errno to ENOENT even if we return NULL.

It seems redundant: strmap_get() and strmap_del() can only return NULL
when the string is not a member.  However, it became clear in writing
ccan/tsort that it's much more convenient for callers if we set errno
in this case too, so they can pass it up.
ccan/strmap/strmap.c
ccan/strmap/strmap.h
ccan/strmap/test/run.c