diff options
author | Volker Lendecke <vl@samba.org> | 2014-09-14 20:45:31 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2014-09-18 23:02:38 +0200 |
commit | 221d9f7b8e833d2b3308736da9689e4ad7d8b281 (patch) | |
tree | 1733869a9d74de8c5f7fd91c09a3ed96d78785dc /lib/tevent | |
parent | ed00ac21dc54c5bff3331de874f5ab353d39fbdb (diff) | |
download | samba-221d9f7b8e833d2b3308736da9689e4ad7d8b281.tar.gz |
lib: Polish echo_server
Samba has a lot of struct assignments now, in a lot of cases it simplifies the
code. Use it in the sample code.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Sep 18 23:02:38 CEST 2014 on sn-devel-104
Diffstat (limited to 'lib/tevent')
-rw-r--r-- | lib/tevent/echo_server.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tevent/echo_server.c b/lib/tevent/echo_server.c index a1da0d801bc..102f7b4da79 100644 --- a/lib/tevent/echo_server.c +++ b/lib/tevent/echo_server.c @@ -619,10 +619,10 @@ int main(int argc, const char **argv) exit(1); } - memset(&addr, 0, sizeof(addr)); - - addr.sin_family = AF_INET; - addr.sin_port = htons(port); + addr = (struct sockaddr_in) { + .sin_family = AF_INET, + .sin_port = htons(port) + }; ret = bind(listen_sock, (struct sockaddr *)&addr, sizeof(addr)); if (ret == -1) { |