Skip to content
Open
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
14 changes: 11 additions & 3 deletions core/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

extern struct uwsgi_server uwsgi;

// Forward declaration for function defined in uwsgi.c
extern void uwsgi_plugins_atexit(void);

#ifdef __BIG_ENDIAN__
uint16_t uwsgi_swap16(uint16_t x) {
return (uint16_t) ((x & 0xff) << 8 | (x & 0xff00) >> 8);
Expand Down Expand Up @@ -1930,7 +1933,7 @@ char *uwsgi_64bit2str(int64_t num) {
char *uwsgi_size2str(size_t num) {
char *str = uwsgi_malloc(sizeof(UMAX64_STR) + 1);
snprintf(str, sizeof(UMAX64_STR) + 1, "%llu", (unsigned long long) num);
return str;
return str;
}

int uwsgi_num2str2(int num, char *ptr) {
Expand Down Expand Up @@ -4476,8 +4479,13 @@ void uwsgi_opt_envdir(char *opt, char *value, void *foobar) {

void uwsgi_exit(int status) {
uwsgi.last_exit_code = status;
// disable macro expansion
(exit) (status);

// Call uwsgi-specific cleanup.
if (!uwsgi.skip_atexit) {
uwsgi_plugins_atexit();
}

(_exit) (status);
}

int uwsgi_base128(struct uwsgi_buffer *ub, uint64_t l, int first) {
Expand Down