tree-wide: make FOREACH_DIRENT_ALL define the iterator variable
The variable is not useful outside of the loop (it'll always be null after the loop is finished), so we can declare it inline in the loop. This saves one variable declaration and reduces the chances that somebody tries to use the variable outside of the loop. For consistency, 'de' is used everywhere for the var name.
This commit is contained in:
@@ -313,8 +313,6 @@ static int recurse_fd(int fd, bool donate_fd, const struct stat *st, uid_t shift
|
||||
goto read_only;
|
||||
|
||||
if (S_ISDIR(st->st_mode)) {
|
||||
struct dirent *de;
|
||||
|
||||
if (!donate_fd) {
|
||||
int copy;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user