diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-03-31 05:36:56 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-03-31 05:36:56 -0400 |
commit | 75ffcee53dc3dc8b2d2258ce2bdcee0c5c834d7f (patch) | |
tree | a79653d6970143f13fcbb89edb730919749457f0 | |
parent | 53c63390e822d24a2aa21ea8eca3d101658e361a (diff) |
trace-cmd: Fix typo in connect()
The loop after getaddrinfo() needs to test connect() against -1, not 1.
Reported-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/trace-cmd.c b/trace-cmd.c index 1869c1e..9214ee1 100644 --- a/trace-cmd.c +++ b/trace-cmd.c | |||
@@ -949,7 +949,7 @@ static void connect_port(int cpu) | |||
949 | rp->ai_protocol); | 949 | rp->ai_protocol); |
950 | if (sfd == -1) | 950 | if (sfd == -1) |
951 | continue; | 951 | continue; |
952 | if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != 1) | 952 | if (connect(sfd, rp->ai_addr, rp->ai_addrlen) != -1) |
953 | break; | 953 | break; |
954 | close(sfd); | 954 | close(sfd); |
955 | } | 955 | } |