Skip to content

Commit

Permalink
cleanup: Remove duplicated perms code
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jamesodhunt committed Nov 9, 2024
1 parent af5a866 commit cbb6269
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions src/platform/linux/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions src/procenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cbb6269

Please sign in to comment.