Skip to content

Commit 96136b3

Browse files
authored
Merge pull request #2000 from eriksjolund/utils-fix-error-code
utils: do not use errno after success
2 parents d0c1224 + 9a23231 commit 96136b3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/libcrun/utils.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,10 +1040,7 @@ get_realpath_to_file (int dirfd, const char *path_name, char **absolute_path, li
10401040
get_proc_self_fd_path (target_fd_path, targetfd);
10411041
len = safe_readlinkat (AT_FDCWD, target_fd_path, absolute_path, 0, err);
10421042
if (UNLIKELY (len < 0))
1043-
{
1044-
crun_error_release (err);
1045-
return crun_make_error (err, errno, "error unable to provide absolute path to file `%s`", path_name);
1046-
}
1043+
return crun_error_wrap (err, "error unable to provide absolute path to file `%s`", path_name);
10471044
}
10481045

10491046
return 0;

0 commit comments

Comments
 (0)