Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* nis/ypclnt.c (do_ypcall): Add one missing unlock.  Simplify the
	code a bit.
  • Loading branch information
Ulrich Drepper committed Sep 25, 2004
1 parent 43ca813 commit 9435d38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2004-09-24 Ulrich Drepper <drepper@redhat.com>

* nis/ypclnt.c (do_ypcall): Add one missing unlock. Simplify the
code a bit.

* misc/daemon.c (daemon): Define errno in case /dev/null is not
the correct device.

Expand Down
16 changes: 7 additions & 9 deletions nis/ypclnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,10 @@ do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
status = YPERR_YPERR;

__libc_lock_lock (ypbindlist_lock);
if (__ypbindlist != NULL)
ydb = __ypbindlist;
while (ydb != NULL)
{
ydb = __ypbindlist;
while (ydb != NULL)
{
if (strcmp (domain, ydb->dom_domain) == 0)
break;
ydb = ydb->dom_pnext;
}
if (ydb != NULL)
if (strcmp (domain, ydb->dom_domain) == 0)
{
if (__yp_bind (domain, &ydb) == 0)
{
Expand All @@ -322,14 +316,18 @@ do_ypcall (const char *domain, u_long prog, xdrproc_t xargs,
resp, &ydb, 0);
if (status == YPERR_SUCCESS)
{
__libc_lock_unlock (ypbindlist_lock);
__set_errno (saved_errno);
return status;
}
}
/* We use ypbindlist, and the old cached data is
invalid. unbind now and create a new binding */
yp_unbind_locked (domain);

break;
}
ydb = ydb->dom_pnext;
}
__libc_lock_unlock (ypbindlist_lock);

Expand Down

0 comments on commit 9435d38

Please sign in to comment.