diff options
author | Volker Lendecke <vl@samba.org> | 2011-02-10 14:59:39 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-02-10 17:00:46 +0100 |
commit | 831974a762b890982e17bc641253ebaf8df4444d (patch) | |
tree | b53855ed142458cc5ab502b3b3d34c6613fd4e20 /nsswitch | |
parent | d7d36724d3120167caf487bda863fc350b27bfa7 (diff) | |
download | samba-831974a762b890982e17bc641253ebaf8df4444d.tar.gz samba-831974a762b890982e17bc641253ebaf8df4444d.tar.bz2 samba-831974a762b890982e17bc641253ebaf8df4444d.zip |
s3: Slightly simplify winbind_write_sock
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Feb 10 17:00:46 CET 2011 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/wb_common.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/nsswitch/wb_common.c b/nsswitch/wb_common.c index 9a3788a072..ccc5142d9c 100644 --- a/nsswitch/wb_common.c +++ b/nsswitch/wb_common.c @@ -403,31 +403,29 @@ static int winbind_write_sock(void *buffer, int count, int recursing, /* Write should be OK if fd not available for reading */ - if (!FD_ISSET(winbindd_fd, &r_fds)) { + if (FD_ISSET(winbindd_fd, &r_fds)) { - /* Do the write */ + /* Pipe has closed on remote end */ - result = write(winbindd_fd, - (char *)buffer + nwritten, - count - nwritten); + winbind_close_sock(); + goto restart; + } - if ((result == -1) || (result == 0)) { + /* Do the write */ - /* Write failed */ + result = write(winbindd_fd, + (char *)buffer + nwritten, + count - nwritten); - winbind_close_sock(); - return -1; - } - - nwritten += result; + if ((result == -1) || (result == 0)) { - } else { - - /* Pipe has closed on remote end */ + /* Write failed */ winbind_close_sock(); - goto restart; + return -1; } + + nwritten += result; } return nwritten; |