~james-page/ubuntu/saucy/openvswitch/1.12-snapshot

« back to all changes in this revision

Viewing changes to tests/test-vconn.c

  • Committer: James Page
  • Date: 2013-08-21 10:16:57 UTC
  • mfrom: (1.1.20)
  • Revision ID: james.page@canonical.com-20130821101657-3o0z0qeiv5zkwlzi
New upstream snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
check_errno(int a, int b, const char *as, const char *file, int line)
60
60
{
61
61
    if (a != b) {
62
 
        char *str_b = strdup(strerror(abs(b)));
 
62
        char *str_b = strdup(ovs_strerror(abs(b)));
63
63
        ovs_fatal(0, "%s:%d: %s is %d (%s) but should be %d (%s)",
64
 
                  file, line, as, a, strerror(abs(a)), b, str_b);
 
64
                  file, line, as, a, ovs_strerror(abs(a)), b, str_b);
65
65
    }
66
66
}
67
67
 
156
156
    if (!strcmp(type, "tcp")) {
157
157
        if (error != ECONNRESET && error != EPIPE) {
158
158
            ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)",
159
 
                      error, strerror(error));
 
159
                      error, ovs_strerror(error));
160
160
        }
161
161
    } else if (!strcmp(type, "unix")) {
162
162
        CHECK_ERRNO(error, EPIPE);
163
163
    } else if (!strcmp(type, "ssl")) {
164
164
        if (error != EPROTO && error != ECONNRESET) {
165
165
            ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)",
166
 
                      error, strerror(error));
 
166
                      error, ovs_strerror(error));
167
167
        }
168
168
    } else {
169
169
        ovs_fatal(0, "invalid connection type %s", type);
194
194
    if (!strcmp(type, "tcp") || !strcmp(type, "unix")) {
195
195
        if (error != ECONNRESET && error != EPIPE) {
196
196
            ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)",
197
 
                      error, strerror(error));
 
197
                      error, ovs_strerror(error));
198
198
        }
199
199
    } else {
200
200
        CHECK_ERRNO(error, EPROTO);
249
249
    error = vconn_connect_block(vconn);
250
250
    if (error != ECONNRESET && error != EPIPE) {
251
251
        ovs_fatal(0, "unexpected vconn_connect() return value %d (%s)",
252
 
                  error, strerror(error));
 
252
                  error, ovs_strerror(error));
253
253
    }
254
254
    vconn_close(vconn);
255
255
}