Skip to content

Commit 0a797c7

Browse files
committed
CXX-11 call abort rather than exit
1 parent 29369f4 commit 0a797c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mongo/client/scoped_db_conn_test.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace mongo {
111111

112112
if (_fd == -1) {
113113
perror("Failed to get file descriptor");
114-
std::exit(1);
114+
std::abort();
115115
}
116116
}
117117

@@ -121,7 +121,7 @@ namespace mongo {
121121
if (optset < 0) {
122122
perror("Failed to set socket opts");
123123
close();
124-
std::exit(2);
124+
std::abort();
125125
}
126126
}
127127

@@ -130,7 +130,7 @@ namespace mongo {
130130
if (bound != 0) {
131131
perror("Failed to bind");
132132
close();
133-
std::exit(4);
133+
std::abort();
134134
}
135135
}
136136

@@ -139,7 +139,7 @@ namespace mongo {
139139
if (listening != 0) {
140140
perror("Failed to listen");
141141
close();
142-
std::exit(5);
142+
std::abort();
143143
}
144144
}
145145

@@ -166,7 +166,7 @@ namespace mongo {
166166
int client_fd;
167167
if ((client_fd= ::accept(_fd, client_sa.get_address(), &client_sa.size)) == -1) {
168168
perror("accept");
169-
std::exit(6);
169+
std::abort();
170170
} else {
171171
return new TCPSocket(client_sa, client_fd);
172172
}
@@ -207,7 +207,7 @@ namespace mongo {
207207

208208
if (selected == -1) {
209209
perror("select");
210-
std::exit(7);
210+
std::abort();
211211
}
212212
else if (selected > 0 && FD_ISSET(server_fd, &readable_fd_set)) {
213213
TCPSocket* p_new_sock = _server_sock.accept();

0 commit comments

Comments
 (0)