/*
- * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
error = EPROTO;
}
if (bind_path) {
- fatal_signal_remove_file_to_unlink(bind_path);
+ fatal_signal_unlink_file_now(bind_path);
}
close(fd);
return -error;
unsigned int yes = 1;
if (!inet_parse_passive(target, default_port, &sin)) {
- return EAFNOSUPPORT;
+ return -EAFNOSUPPORT;
}
/* Create non-blocking socket, set SO_REUSEADDR. */
if (fd < 0) {
error = errno;
VLOG_ERR("%s: socket: %s", target, strerror(error));
- return error;
+ return -error;
}
error = set_nonblocking(fd);
if (error) {
goto error;
}
if (sin.sin_family != AF_INET || sin_len != sizeof sin) {
+ error = EAFNOSUPPORT;
VLOG_ERR("%s: getsockname: invalid socket name", target);
goto error;
}
error:
close(fd);
- return error;
+ return -error;
}
/* Returns a readable and writable fd for /dev/null, if successful, otherwise