Mercurial > dovecot > core-2.2
view src/stats/client-reset.c @ 21389:59437f8764c6
global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Used the following script:
C_FILES=`git ls-files *.c`
H_FILES=`git ls-files *.h`
for F in "$C_FILES $H_FILES"; do
echo "$F"
perl -p -i -e 's/safe_memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero_safe(&$1)/g' $F
perl -p -i -e 's/safe_memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero_safe($1)/g' $F
perl -p -i -e 's/memset\(&\(?([^,]*)\)?,\s*0,\s*sizeof\(\g1\)\)/i_zero(&$1)/g' $F
perl -p -i -e 's/memset\(([^,]*),\s*0,\s*sizeof\(\*\g1\)\)/i_zero($1)/g' $F
done
author | Stephan Bosch <stephan.bosch@dovecot.fi> |
---|---|
date | Wed, 11 Jan 2017 01:57:46 +0100 |
parents | 50456ea55fec |
children | 2e2563132d5f |
line wrap: on
line source
/* Copyright (c) 2016 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "ostream.h" #include "strescape.h" #include "mail-stats.h" #include "client.h" #include "client-reset.h" int client_stats_reset(struct client *client, const char *const *args ATTR_UNUSED, const char **error_r ATTR_UNUSED) { struct mail_global *g = &mail_global_stats; stats_reset(g->stats); g->num_logins = 0; g->num_cmds = 0; g->reset_timestamp = ioloop_time; i_zero(&g->last_update); o_stream_nsend_str(client->output, "OK\n"); return 0; }