From cbb6269b95f1ec26a49fc04eb03e2eaa739d10d8 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Sat, 9 Nov 2024 11:24:31 +0000 Subject: [PATCH] cleanup: Remove duplicated perms code Remove the redundant duplicated permissions handling code in `show_fds_linux()` and `show_stat()` after calling `format_perms()` since that function handles the logic itself. Signed-off-by: James O. D. Hunt --- src/platform/linux/platform.c | 7 ------- src/procenv.c | 7 ------- 2 files changed, 14 deletions(-) diff --git a/src/platform/linux/platform.c b/src/platform/linux/platform.c index 80371a1..0ed9bfd 100644 --- a/src/platform/linux/platform.c +++ b/src/platform/linux/platform.c @@ -586,13 +586,6 @@ show_fds_linux (void) die("failed to allocate space for permissions string"); perms = (st.st_mode & ~S_IFMT); - if (perms & S_ISUID) - modestr[3] = 's'; - if (perms & S_ISGID) - modestr[6] = 's'; - if (perms & S_ISVTX) - modestr[9] = 't'; - section_open("permissions"); entry("octal", "%4.4o", perms); diff --git a/src/procenv.c b/src/procenv.c index 86cfe24..6406d58 100644 --- a/src/procenv.c +++ b/src/procenv.c @@ -1920,13 +1920,6 @@ show_stat (void) die ("failed to allocate space for permissions string"); perms = (st.st_mode & ~S_IFMT); - if (perms & S_ISUID) - modestr[3] = 's'; - if (perms & S_ISGID) - modestr[6] = 's'; - if (perms & S_ISVTX) - modestr[9] = 't'; - section_open ("permissions"); entry ("octal", "%4.4o", perms);