mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00:00
Minor optimization, drop expensive memset() ops
No need to zero out whole buffer for strlcat(), or other string check ops. Also drop a few completely useless memset() calls. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d43af8c9c1
commit
c0716d7f63
4 files changed
+6
-10
No files matched your search
+2
-2
@@ -357,7 +357,7 @@ char *lim2str(struct rlimit *rlim)
|
||||
char tmp[25];
|
||||
static char buf[42];
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
buf[0] = 0;
|
||||
if (RLIM_INFINITY == rlim->rlim_cur)
|
||||
snprintf(tmp, sizeof(tmp), "unlimited, ");
|
||||
else
|
||||
@@ -661,7 +661,7 @@ static int parse_conf(char *file, int is_rcsd)
|
||||
/* Prepare default limits and group for each service in /etc/finit.d/ */
|
||||
if (is_rcsd) {
|
||||
memcpy(rlimit, global_rlimit, sizeof(rlimit));
|
||||
memset(cgroup_current, 0, sizeof(cgroup_current));
|
||||
cgroup_current[0] = 0;
|
||||
}
|
||||
|
||||
_d("*** Parsing %s", file);
|
||||
|
||||
Reference in new issue
Block a user