/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
if (cmd_error) {
+ jsonrpc_close(client);
fputs(cmd_error, stderr);
ovs_error(0, "%s: server returned an error", target);
exit(2);
} else if (cmd_result) {
fputs(cmd_result, stdout);
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
jsonrpc_close(client);
exit(EXIT_FAILURE);
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
char *socket_name;
int error;
+#ifndef _WIN32
if (target[0] != '/') {
char *pidfile_name;
pid_t pid;
free(pidfile_name);
socket_name = xasprintf("%s/%s.%ld.ctl",
ovs_rundir(), target, (long int) pid);
+#else
+ /* On windows, if the 'target' contains ':', we make an assumption that
+ * it is an absolute path. */
+ if (!strchr(target, ':')) {
+ socket_name = xasprintf("%s/%s.ctl", ovs_rundir(), target);
+#endif
} else {
socket_name = xstrdup(target);
}