summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-02-10 04:02:53 +0000
committerGerald Carter <jerry@samba.org>2004-02-10 04:02:53 +0000
commit45616e18a866fc54f046d17ecd615e16d820250e (patch)
tree2d6a7775d743065ee16cf4b97b7da4bff4306c69 /source3/lib
parent19b8f496f8d7cf91c67645ee5163bb3a90bef0dd (diff)
downloadsamba-45616e18a866fc54f046d17ecd615e16d820250e.tar.gz
samba-45616e18a866fc54f046d17ecd615e16d820250e.tar.bz2
samba-45616e18a866fc54f046d17ecd615e16d820250e.zip
more fixes from the static changes; please move static functions to the top of files to prevent this from happening
(This used to be commit 7a61c2ae450d3e41c45e6e3773ad00f6ab9beb16)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util_sock.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 594bc121b1..782f5f3f73 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -29,6 +29,29 @@ int lastport=0;
int smb_read_error = 0;
+static char *get_socket_addr(int fd)
+{
+ struct sockaddr sa;
+ struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa);
+ int length = sizeof(sa);
+ static fstring addr_buf;
+
+ fstrcpy(addr_buf,"0.0.0.0");
+
+ if (fd == -1) {
+ return addr_buf;
+ }
+
+ if (getsockname(fd, &sa, &length) < 0) {
+ DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) ));
+ return addr_buf;
+ }
+
+ fstrcpy(addr_buf,(char *)inet_ntoa(sockin->sin_addr));
+
+ return addr_buf;
+}
+
/****************************************************************************
Determine if a file descriptor is in fact a socket.
****************************************************************************/
@@ -958,29 +981,6 @@ char *get_peer_addr(int fd)
return addr_buf;
}
-static char *get_socket_addr(int fd)
-{
- struct sockaddr sa;
- struct sockaddr_in *sockin = (struct sockaddr_in *) (&sa);
- int length = sizeof(sa);
- static fstring addr_buf;
-
- fstrcpy(addr_buf,"0.0.0.0");
-
- if (fd == -1) {
- return addr_buf;
- }
-
- if (getsockname(fd, &sa, &length) < 0) {
- DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) ));
- return addr_buf;
- }
-
- fstrcpy(addr_buf,(char *)inet_ntoa(sockin->sin_addr));
-
- return addr_buf;
-}
-
/*******************************************************************
Create protected unix domain socket.