From e735ad6710a82604a206ad29f6cbcdd7dc4b024c Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sun, 14 May 2023 21:43:02 -0400 Subject: refactor and add su --- command/chmod.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'command/chmod.c') diff --git a/command/chmod.c b/command/chmod.c index 9e2972e..ef4ec3d 100644 --- a/command/chmod.c +++ b/command/chmod.c @@ -1,4 +1,3 @@ -#include "args.h" #include "command.h" #include "lslib.h" @@ -7,7 +6,6 @@ #include #include #include -#include #include enum method { @@ -27,7 +25,7 @@ static struct { static void help (void) { printf("Usage: chmod [-Rcvf] MODE[,MODE]... FILE...\n\n"); - printf("MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst]\n\n"); + printf("MODE is octal number (bit pattern sstrwxrwxrwx) or {+|-|=}[rwxXst]\n\n"); printf("\t-R\tRecurse\n"); printf("\t-c\tList changed files\n"); printf("\t-v\tVerbose\n"); @@ -73,7 +71,7 @@ static void chmod_file(char* path) { if (lstat(get_path_buffer(), &s) < 0) { if (!flags.quiet) { - error_s("cannot stat '%s': %s", get_path_buffer(), strerror(errno)); + error_s("cannot stat '%s'", get_path_buffer()); } pop_path_buffer(save); return; @@ -89,7 +87,7 @@ static void chmod_file(char* path) { if (chmod(get_path_buffer(), mode) < 0) { if (!flags.quiet) { - error_s("cannot chmod '%s': %s", get_path_buffer(), strerror(errno)); + error_s("cannot chmod '%s'", get_path_buffer()); } pop_path_buffer(save); return; @@ -110,7 +108,7 @@ static void chmod_file(char* path) { d = opendir(get_path_buffer()); if (d == NULL) { if (!flags.quiet) { - error_s("cannot open dir '%s': %s", get_path_buffer(), strerror(errno)); + error_s("cannot open dir '%s'", get_path_buffer()); } pop_path_buffer(save); return; -- cgit v1.2.3-freya