Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmd/traffic_manager/traffic_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@ init_dirs()
if (access(sysconfdir, R_OK) == -1) {
mgmt_elog(0, "unable to access() config directory '%s': %d, %s\n", (const char *)sysconfdir, errno, strerror(errno));
mgmt_elog(0, "please set the 'TS_ROOT' environment variable\n");
_exit(1);
::exit(1);
}

if (access(rundir, R_OK) == -1) {
mgmt_elog(0, "unable to access() local state directory '%s': %d, %s\n", (const char *)rundir, errno, strerror(errno));
mgmt_elog(0, "please set 'proxy.config.local_state_dir'\n");
_exit(1);
::exit(1);
}
}

Expand Down Expand Up @@ -817,12 +817,12 @@ main(int argc, const char **argv)
switch (lmgmt->mgmt_shutdown_outstanding) {
case MGMT_PENDING_RESTART:
lmgmt->mgmtShutdown();
_exit(0);
::exit(0);
break;
case MGMT_PENDING_IDLE_RESTART:
if (is_server_idle()) {
lmgmt->mgmtShutdown();
_exit(0);
::exit(0);
}
break;
case MGMT_PENDING_BOUNCE:
Expand Down Expand Up @@ -988,11 +988,11 @@ SignalHandler(int sig)
default:
fprintf(stderr, "[TrafficManager] ==> signal #%d\n", sig);
mgmt_elog(stderr, 0, "[TrafficManager] ==> signal #%d\n", sig);
_exit(sig);
::exit(sig);
}
fprintf(stderr, "[TrafficManager] ==> signal2 #%d\n", sig);
mgmt_elog(stderr, 0, "[TrafficManager] ==> signal2 #%d\n", sig);
_exit(sig);
::exit(sig);
} /* End SignalHandler */

// void SigChldHandler(int sig)
Expand Down
4 changes: 2 additions & 2 deletions cmd/traffic_wccp/wccp_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ check_lockfile()
} else {
fprintf(stderr, "\n");
}
_exit(1);
::exit(1);
}
}

Expand Down Expand Up @@ -192,7 +192,7 @@ main(int argc, char **argv)
pid_t pid = fork();
if (pid > 0) {
// Successful, the parent should go away
_exit(0);
::exit(0);
}
}

Expand Down
23 changes: 16 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ AC_MSG_RESULT([$enable_debug])

# Enable code coverage instrumentation only if requested by the user.
AC_MSG_CHECKING([whether to code coverage])
AC_ARG_ENABLE([debug],
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],[generate code coverage instrumentation])],
[],
[enable_coverage=no]
Expand Down Expand Up @@ -917,8 +917,10 @@ AS_IF([test x"$enable_coverage" = "xyes"], [
# supported compiler to test coverage.
AS_CASE("$ax_cv_c_compiler_vendor",
[clang], [
TS_ADDTO(CXXFLAGS, "-fprofile-instr-generate -fcoverage-mapping")
TS_ADDTO(CFLAGS, "-fprofile-instr-generate -fcoverage-mapping")
TS_ADDTO(CXXFLAGS, "-fprofile-instr-generate")
TS_ADDTO(CXXFLAGS, "-fcoverage-mapping")
TS_ADDTO(CFLAGS, "-fprofile-instr-generate")
TS_ADDTO(CFLAGS, "-fcoverage-mapping")
], [gnu], [
TS_ADDTO(CXXFLAGS, "--coverage")
TS_ADDTO(CFLAGS, "--coverage")
Expand Down Expand Up @@ -946,10 +948,6 @@ AC_SUBST(AM_CXXFLAGS)
# Special compiler flag hacks for various pieces of the code
AC_SUBST([FLEX_CFLAGS], $flex_cflags)

# Flags for buildit LuaJIT itself.
AC_SUBST(LUA_LDFLAGS)
AC_SUBST([LUA_CFLAGS], $lua_cflags)

SHARED_CFLAGS=-fPIC
SHARED_LDFLAGS=-shared
SHARED_CXXFLAGS=-fPIC
Expand Down Expand Up @@ -1893,6 +1891,17 @@ iocore_include_dirs="\
-I\$(top_srcdir)/iocore/utils \
-I\$(top_srcdir)/iocore/dns"

# Flags for buildit LuaJIT itself. We take the latest version
# of the generic flags, plus any Lua-specific flags so that we
# can strip the coverage flags from Lua while keeping them by
# default everywhere else.
AC_SUBST([LUA_CFLAGS], [$CFLAGS $lua_cflags])
AC_SUBST(LUA_LDFLAGS)

TS_REMOVEFROM(LUA_CFLAGS, "-fprofile-instr-generate")
TS_REMOVEFROM(LUA_CFLAGS, "-fcoverage-mapping")
TS_REMOVEFROM(LUA_CFLAGS, "--coverage")

AC_SUBST([CC])
AC_SUBST([CFLAGS])
AC_SUBST([CXX])
Expand Down
3 changes: 1 addition & 2 deletions iocore/net/Connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ Server::setup_fd_for_listen(bool non_blocking, int recv_bufsize, int send_bufsiz
#if TS_USE_TPROXY
Debug("http_tproxy", "Listen port inbound transparency enabled.\n");
if (safe_setsockopt(fd, SOL_IP, TS_IP_TRANSPARENT, SOCKOPT_ON, sizeof(int)) < 0) {
Error("[Server::listen] Unable to set transparent socket option [%d] %s\n", errno, strerror(errno));
_exit(1);
Fatal("[Server::listen] Unable to set transparent socket option [%d] %s\n", errno, strerror(errno));
}
#else
Error("[Server::listen] Transparency requested but TPROXY not configured\n");
Expand Down
4 changes: 2 additions & 2 deletions iocore/net/SSLClientUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ SSLInitClientContext(const SSLConfigParams *params)
SSL_CTX_set_options(client_ctx, params->ssl_ctx_options);
if (!client_ctx) {
SSLError("cannot create new client context");
_exit(1);
::exit(1);
}

if (params->ssl_client_ctx_protocols) {
Expand Down Expand Up @@ -182,5 +182,5 @@ SSLInitClientContext(const SSLConfigParams *params)

fail:
SSLReleaseContext(client_ctx);
_exit(1);
::exit(1);
}
4 changes: 2 additions & 2 deletions iocore/net/SSLConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ SSLCertificateConfig::startup()
// proxy.config.ssl.server.multicert.exit_on_load_fail is true
SSLConfig::scoped_config params;
if (!reconfigure() && params->configExitOnLoadError) {
Error("Problems loading ssl certificate file, %s. Exiting.", params->configFilePath);
_exit(1);
Fatal("failed to load SSL certificate file, %s", params->configFilePath);
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion iocore/net/test_I_UDPNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ EchoServer::handlePacket(int event, void *data)

case NET_EVENT_DATAGRAM_READ_ERROR:
printf("got Read Error exiting\n");
_exit(1);
::exit(1);

case NET_EVENT_DATAGRAM_WRITE_ERROR:
printf("got write error: %d\n", (int)data);
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/test_P_UDPNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ EchoServer::handlePacket(int event, void *data)

case NET_EVENT_DATAGRAM_READ_ERROR:
printf("got Read Error exiting\n");
_exit(1);
::exit(1);

case NET_EVENT_DATAGRAM_WRITE_ERROR:
printf("got write error: %d\n", (int)data);
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ all-local:
BUILDMODE="static" \
PREFIX="$(prefix)" \
CC="$(CC)" \
CFLAGS="$(CFLAGS) $(LUA_CFLAGS)" \
CFLAGS="$(LUA_CFLAGS)" \
XCFLAGS="" \
LDFLAGS="$(LUA_LDFLAGS)"

Expand Down
2 changes: 1 addition & 1 deletion lib/ts/ink_args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,5 +328,5 @@ usage(const ArgumentDescription *argument_descriptions, unsigned n_argument_desc
}
fprintf(stderr, " %s\n", argument_descriptions[i].description);
}
_exit(EX_USAGE);
::exit(EX_USAGE);
}
22 changes: 8 additions & 14 deletions mgmt/LocalManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ LocalManager::startProxy()
RecSetRecordInt("proxy.node.restarts.proxy.start_time", proxy_started_at, REC_SOURCE_DEFAULT);
RecSetRecordInt("proxy.node.restarts.proxy.restart_count", proxy_launch_count, REC_SOURCE_DEFAULT);
} else {
int res, i = 0;
int i = 0;
char *options[32], *last, *tok;
bool open_ports_p = false;

Expand Down Expand Up @@ -945,9 +945,8 @@ LocalManager::startProxy()

EnableDeathSignal(SIGTERM);

res = execv(absolute_proxy_binary, options);
mgmt_elog(stderr, errno, "[LocalManager::startProxy] Exec of %s failed\n", absolute_proxy_binary);
_exit(res);
execv(absolute_proxy_binary, options);
mgmt_fatal(stderr, errno, "[LocalManager::startProxy] Exec of %s failed\n", absolute_proxy_binary);
}
return true;
}
Expand Down Expand Up @@ -1010,8 +1009,7 @@ LocalManager::bindProxyPort(HttpProxyPort &port)

/* Setup reliable connection, for large config changes */
if ((port.m_fd = socket(port.m_family, SOCK_STREAM, 0)) < 0) {
mgmt_elog(stderr, 0, "[bindProxyPort] Unable to create socket : %s\n", strerror(errno));
_exit(1);
mgmt_fatal(stderr, 0, "[bindProxyPort] Unable to create socket : %s\n", strerror(errno));
}

if (port.m_type == HttpProxyPort::TRANSPORT_DEFAULT) {
Expand All @@ -1031,16 +1029,14 @@ LocalManager::bindProxyPort(HttpProxyPort &port)
}
}
if (setsockopt(port.m_fd, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(int)) < 0) {
mgmt_elog(stderr, 0, "[bindProxyPort] Unable to set socket options: %d : %s\n", port.m_port, strerror(errno));
_exit(1);
mgmt_fatal(stderr, 0, "[bindProxyPort] Unable to set socket options: %d : %s\n", port.m_port, strerror(errno));
}

if (port.m_inbound_transparent_p) {
#if TS_USE_TPROXY
Debug("http_tproxy", "Listen port %d inbound transparency enabled.\n", port.m_port);
if (setsockopt(port.m_fd, SOL_IP, TS_IP_TRANSPARENT, &one, sizeof(one)) == -1) {
mgmt_elog(stderr, 0, "[bindProxyPort] Unable to set transparent socket option [%d] %s\n", errno, strerror(errno));
_exit(1);
mgmt_fatal(stderr, 0, "[bindProxyPort] Unable to set transparent socket option [%d] %s\n", errno, strerror(errno));
}
#else
Debug("lm", "[bindProxyPort] Transparency requested but TPROXY not configured\n");
Expand All @@ -1061,13 +1057,11 @@ LocalManager::bindProxyPort(HttpProxyPort &port)
else
ip.setToAnyAddr(AF_INET);
} else {
mgmt_elog(stderr, 0, "[bindProxyPort] Proxy port with invalid address type %d\n", port.m_family);
_exit(1);
mgmt_fatal(stderr, 0, "[bindProxyPort] Proxy port with invalid address type %d\n", port.m_family);
}
ip.port() = htons(port.m_port);
if (bind(port.m_fd, &ip.sa, ats_ip_size(&ip)) < 0) {
mgmt_elog(stderr, 0, "[bindProxyPort] Unable to bind socket: %d : %s\n", port.m_port, strerror(errno));
_exit(1);
mgmt_fatal(stderr, 0, "[bindProxyPort] Unable to bind socket: %d : %s\n", port.m_port, strerror(errno));
}

Debug("lm", "[bindProxyPort] Successfully bound proxy port %d\n", port.m_port);
Expand Down
3 changes: 1 addition & 2 deletions mgmt/ProcessManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ ProcessManager::processEventQueue()
executeMgmtCallback(mh->msg_id, NULL, 0);
}
if (mh->msg_id == MGMT_EVENT_SHUTDOWN) {
mgmt_log(stderr, "[ProcessManager::processEventQueue] Shutdown msg received, exiting\n");
_exit(0);
mgmt_fatal(stderr, 0, "[ProcessManager::processEventQueue] Shutdown msg received, exiting\n");
} /* Exit on shutdown */
ats_free(mh);
ret = true;
Expand Down
4 changes: 2 additions & 2 deletions mgmt/utils/MgmtUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ mgmt_fatal(FILE *log, const int lerrno, const char *message_format, ...)
va_end(ap);

mgmt_cleanup();
_exit(1);
::exit(1);
} /* End mgmt_fatal */

void
Expand Down Expand Up @@ -423,7 +423,7 @@ mgmt_fatal(const int lerrno, const char *message_format, ...)
va_end(ap);

mgmt_cleanup();
_exit(1);
::exit(1);
} /* End mgmt_fatal */

static inline int
Expand Down
24 changes: 12 additions & 12 deletions proxy/CoreUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ CoreUtils::load_http_hdr(HTTPHdr *core_hdr, HTTPHdr *live_hdr)
do {
if (read_from_core((intptr_t)heap, sizeof(HdrHeap), buf) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}
heap = (HdrHeap *)buf;
copy_size = (int)(heap->m_free_start - heap->m_data_start);
Expand All @@ -522,14 +522,14 @@ CoreUtils::load_http_hdr(HTTPHdr *core_hdr, HTTPHdr *live_hdr)
do {
if (read_from_core((intptr_t)heap_ptr, sizeof(HdrHeap), buf) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}
heap_ptr = (HdrHeap *)buf;
copy_size = (int)(heap_ptr->m_free_start - heap_ptr->m_data_start);

if (read_from_core((intptr_t)heap_ptr->m_data_start, copy_size, ptr_data) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}
// Expand ptr xlation table if necessary
if (ptr_heaps >= ptr_xl_size) {
Expand All @@ -552,7 +552,7 @@ CoreUtils::load_http_hdr(HTTPHdr *core_hdr, HTTPHdr *live_hdr)
heap = (HdrHeap *)http_hdr->m_heap;
if (read_from_core((intptr_t)heap, sizeof(HdrHeap), buf) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}
heap = (HdrHeap *)buf;
// filling in the live_hdr
Expand Down Expand Up @@ -585,7 +585,7 @@ CoreUtils::load_http_hdr(HTTPHdr *core_hdr, HTTPHdr *live_hdr)
char *str_hdr = (char *)ats_malloc(sizeof(char) * sizeof(HdrStrHeap));
if (read_from_core((intptr_t)hdr, sizeof(HdrStrHeap), str_hdr) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}

char *free_start = (char *)(((HdrStrHeap *)str_hdr)->m_free_start);
Expand All @@ -598,7 +598,7 @@ CoreUtils::load_http_hdr(HTTPHdr *core_hdr, HTTPHdr *live_hdr)
#endif
if (read_from_core((intptr_t)copy_start, nto_copy, rw_heap) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}
// FIX ME - possible offset overflow issues?
str_xlation[str_heaps].start = copy_start;
Expand All @@ -621,7 +621,7 @@ CoreUtils::load_http_hdr(HTTPHdr *core_hdr, HTTPHdr *live_hdr)
#endif
if (read_from_core((intptr_t)heap->m_ronly_heap[i].m_heap_start, heap->m_ronly_heap[i].m_heap_len, ro_heap) == -1) {
printf("Cannot read from core\n");
_exit(0);
::exit(0);
}
// Add translation table entry for string heaps
str_xlation[str_heaps].start = heap->m_ronly_heap[i].m_heap_start;
Expand Down Expand Up @@ -811,13 +811,13 @@ process_core(char *fname)
/* Open the input file */
if (!(fp = fopen(fname, "r"))) {
printf("cannot open file\n");
_exit(1);
::exit(1);
}

/* Obtain the .shstrtab data buffer */
if (fread(&ehdr, sizeof ehdr, 1, fp) != 1) {
printf("Unable to read ehdr\n");
_exit(1);
::exit(1);
}
// program header offset
phoff = ehdr.e_phoff;
Expand All @@ -829,12 +829,12 @@ process_core(char *fname)
for (int i = 0; i < phnum; i++) {
if (fseek(fp, phoff + i * phentsize, SEEK_SET) == -1) {
fprintf(stderr, "Unable to seek to Phdr %d\n", i);
_exit(1);
::exit(1);
}

if (fread(&phdr, sizeof phdr, 1, fp) != 1) {
fprintf(stderr, "Unable to read Phdr %d\n", i);
_exit(1);
::exit(1);
}
int poffset, psize;
int pvaddr;
Expand Down Expand Up @@ -882,7 +882,7 @@ process_core(char *fname)
char *offset = (char *)(thdr + 1) + ((thdr->n_namesz + 3) & ~3);

if (len < 0 || len > size) {
_exit(1);
::exit(1);
}
printf("size=%d, len=%d\n", size, len);

Expand Down
Loading