From fe01d2faa10354cf9212f434eeff69435aa288c9 Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Sat, 10 Aug 2019 02:02:41 +0300 Subject: [PATCH] Simplify FreeBSD get_exename() --- c/fs_freebsd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/c/fs_freebsd.c b/c/fs_freebsd.c index d18c453..91c545e 100644 --- a/c/fs_freebsd.c +++ b/c/fs_freebsd.c @@ -6,12 +6,8 @@ char *get_exename(char *buf, size_t size) { - int mib[4]; - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PATHNAME; - mib[3] = -1; - sysctl(mib, 4, buf, &size, 0, 0); + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; + sysctl(mib, 4, buf, &size, 0, 0); return buf; }