aboutsummaryrefslogtreecommitdiff
path: root/coreutils/chmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/chmod.c')
-rw-r--r--coreutils/chmod.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 5ee45b942..a21c6d501 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -69,9 +69,9 @@ static int FAST_FUNC fileAction(const char *fileName, struct stat *statbuf, void
69 if (S_ISLNK(statbuf->st_mode)) 69 if (S_ISLNK(statbuf->st_mode))
70 return TRUE; 70 return TRUE;
71 } 71 }
72 newmode = statbuf->st_mode;
73 72
74 if (!bb_parse_mode((char *)param, &newmode)) 73 newmode = bb_parse_mode((char *)param, statbuf->st_mode);
74 if (newmode == (mode_t)-1)
75 bb_error_msg_and_die("invalid mode '%s'", (char *)param); 75 bb_error_msg_and_die("invalid mode '%s'", (char *)param);
76 76
77 if (chmod(fileName, newmode) == 0) { 77 if (chmod(fileName, newmode) == 0) {