diff options
author | Jeremy Allison <jra@samba.org> | 2005-06-13 22:26:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:13 -0500 |
commit | 33a4c0b5a1052026193dcbb800e2bccb1b832730 (patch) | |
tree | f0daa5eec45dcbeb80f21661bb9259b17d3780ac /source3/libsmb | |
parent | a59149b86a36cd8b51ad5ae11b4d2b0714bb5e9c (diff) | |
download | samba-33a4c0b5a1052026193dcbb800e2bccb1b832730.tar.gz samba-33a4c0b5a1052026193dcbb800e2bccb1b832730.tar.bz2 samba-33a4c0b5a1052026193dcbb800e2bccb1b832730.zip |
r7554: Refactor very messy code in util_sock.c Remove write_socket_data/read_socket_data
as they do nothing that write_socket/read_socket don't do. Add a more useful
error message when read_socket/write_socket error out on the main client fd
for a process (ie. try and list the IP of the client that errored).
Jeremy.
(This used to be commit cbd7578e7c226e6a8002542141b914ed4c7a8269)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 2977099f7d..2e21473511 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -127,6 +127,21 @@ BOOL cli_receive_smb(struct cli_state *cli) return True; } +static ssize_t write_socket(int fd, const char *buf, size_t len) +{ + ssize_t ret=0; + + DEBUG(6,("write_socket(%d,%d)\n",fd,(int)len)); + ret = write_data(fd,buf,len); + + DEBUG(6,("write_socket(%d,%d) wrote %d\n",fd,(int)len,(int)ret)); + if(ret <= 0) + DEBUG(0,("write_socket: Error writing %d bytes to socket %d: ERRNO = %s\n", + (int)len, fd, strerror(errno) )); + + return(ret); +} + /**************************************************************************** Send an smb to a fd. ****************************************************************************/ |