summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2011-02-02 05:26:17 +0000
committerGravatar Karl Ramm <kcr@1ts.org>2011-02-02 05:26:17 +0000
commit819ad52b9f100d870fa0e0b8274a6c1b6d3e1881 (patch)
treebda617abee2dceaa5b096a0c5a0540be7b56a45f /lib
parent8a68b2d387d8785e071a12876969020836196ce5 (diff)
ZOpenPort stashes the port number, no need to getsockname again
Diffstat (limited to 'lib')
-rw-r--r--lib/Zinternal.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/Zinternal.c b/lib/Zinternal.c
index 87c0538..f7fc940 100644
--- a/lib/Zinternal.c
+++ b/lib/Zinternal.c
@@ -650,8 +650,6 @@ Z_FormatHeader(ZNotice_t *notice,
{
Code_t retval;
static char version[BUFSIZ]; /* default init should be all \0 */
- struct sockaddr_in name;
- unsigned int namelen = sizeof(name);
if (!notice->z_sender)
notice->z_sender = ZGetSender();
@@ -662,10 +660,7 @@ Z_FormatHeader(ZNotice_t *notice,
if (retval != ZERR_NONE)
return (retval);
}
- retval = getsockname(ZGetFD(), (struct sockaddr *) &name, &namelen);
- if (retval != 0)
- return (retval);
- notice->z_port = name.sin_port;
+ notice->z_port = __Zephyr_port;
}
notice->z_multinotice = "";
@@ -705,9 +700,7 @@ Z_NewFormatHeader(ZNotice_t *notice,
{
Code_t retval;
static char version[BUFSIZ]; /* default init should be all \0 */
- struct sockaddr_in name;
struct timeval tv;
- unsigned int namelen = sizeof(name);
if (!notice->z_sender)
notice->z_sender = ZGetSender();
@@ -718,10 +711,7 @@ Z_NewFormatHeader(ZNotice_t *notice,
if (retval != ZERR_NONE)
return (retval);
}
- retval = getsockname(ZGetFD(), (struct sockaddr *) &name, &namelen);
- if (retval != 0)
- return (retval);
- notice->z_port = name.sin_port;
+ notice->z_port = __Zephyr_port;
}
notice->z_multinotice = "";