mirror of
https://github.com/systemd/systemd.git
synced 2024-11-24 18:53:33 +08:00
Merge pull request #32286 from YHNdnzj/vpick-null-result
shared/vpick: add missing condition on ret_result
This commit is contained in:
commit
091c26ba9d
@ -141,8 +141,7 @@ static int pin_choice(
|
||||
assert(toplevel_fd >= 0 || toplevel_fd == AT_FDCWD);
|
||||
assert(inode_path);
|
||||
assert(filter);
|
||||
|
||||
toplevel_path = strempty(toplevel_path);
|
||||
assert(ret);
|
||||
|
||||
if (inode_fd < 0 || FLAGS_SET(flags, PICK_RESOLVE)) {
|
||||
r = chaseat(toplevel_fd,
|
||||
@ -271,8 +270,7 @@ static int make_choice(
|
||||
assert(toplevel_fd >= 0 || toplevel_fd == AT_FDCWD);
|
||||
assert(inode_path);
|
||||
assert(filter);
|
||||
|
||||
toplevel_path = strempty(toplevel_path);
|
||||
assert(ret);
|
||||
|
||||
if (inode_fd < 0) {
|
||||
r = chaseat(toplevel_fd, inode_path, CHASE_AT_RESOLVE_IN_ROOT, NULL, &inode_fd);
|
||||
@ -486,7 +484,8 @@ static int make_choice(
|
||||
ret);
|
||||
}
|
||||
|
||||
int path_pick(const char *toplevel_path,
|
||||
int path_pick(
|
||||
const char *toplevel_path,
|
||||
int toplevel_fd,
|
||||
const char *path,
|
||||
const PickFilter *filter,
|
||||
@ -500,8 +499,8 @@ int path_pick(const char *toplevel_path,
|
||||
|
||||
assert(toplevel_fd >= 0 || toplevel_fd == AT_FDCWD);
|
||||
assert(path);
|
||||
|
||||
toplevel_path = strempty(toplevel_path);
|
||||
assert(filter);
|
||||
assert(ret);
|
||||
|
||||
/* Given a path, resolve .v/ subdir logic (if used!), and returns the choice made. This supports
|
||||
* three ways to be called:
|
||||
@ -647,6 +646,7 @@ int path_pick_update_warn(
|
||||
|
||||
assert(path);
|
||||
assert(*path);
|
||||
assert(filter);
|
||||
|
||||
/* This updates the first argument if needed! */
|
||||
|
||||
@ -658,6 +658,8 @@ int path_pick_update_warn(
|
||||
&result);
|
||||
if (r == -ENOENT) {
|
||||
log_debug("Path '%s' doesn't exist, leaving as is.", *path);
|
||||
|
||||
if (ret_result)
|
||||
*ret_result = PICK_RESULT_NULL;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user