diff options
Diffstat (limited to 'coreutils/chmod.c')
-rw-r--r-- | coreutils/chmod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/chmod.c b/coreutils/chmod.c index 5ee45b9..a21c6d5 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 if (S_ISLNK(statbuf->st_mode)) return TRUE; } - newmode = statbuf->st_mode; - if (!bb_parse_mode((char *)param, &newmode)) + newmode = bb_parse_mode((char *)param, statbuf->st_mode); + if (newmode == (mode_t)-1) bb_error_msg_and_die("invalid mode '%s'", (char *)param); if (chmod(fileName, newmode) == 0) { |