mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
fd-util: rename CLOSE_AND_REPLACE() -> close_and_replace()
We have free_and_replace() and friends, they are all named with lower letters, even they are macros, not functions. For consistency, let's rename CLOSE_AND_REPLACE() with lower letters. This also mekes the macro used more places.
This commit is contained in:
committed by
Daan De Meyer
parent
cb19517490
commit
ee3455cf11
@@ -265,8 +265,7 @@ int chase_symlinks(
|
||||
previous_stat = st;
|
||||
}
|
||||
|
||||
safe_close(fd);
|
||||
fd = TAKE_FD(fd_parent);
|
||||
close_and_replace(fd, fd_parent);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -362,8 +361,7 @@ int chase_symlinks(
|
||||
return -ENOMEM;
|
||||
|
||||
/* And iterate again, but go one directory further down. */
|
||||
safe_close(fd);
|
||||
fd = TAKE_FD(child);
|
||||
close_and_replace(fd, child);
|
||||
}
|
||||
|
||||
if (ret_path)
|
||||
|
||||
@@ -654,7 +654,7 @@ int rearrange_stdio(int original_input_fd, int original_output_fd, int original_
|
||||
goto finish;
|
||||
}
|
||||
|
||||
CLOSE_AND_REPLACE(null_fd, copy);
|
||||
close_and_replace(null_fd, copy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static inline int make_null_stdio(void) {
|
||||
})
|
||||
|
||||
/* Like free_and_replace(), but for file descriptors */
|
||||
#define CLOSE_AND_REPLACE(a, b) \
|
||||
#define close_and_replace(a, b) \
|
||||
({ \
|
||||
int *_fdp_ = &(a); \
|
||||
safe_close(*_fdp_); \
|
||||
|
||||
Reference in New Issue
Block a user