projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
afc1fea
)
fileio: fix error propagation in link_tmpfile()
author
Lennart Poettering
<lennart@poettering.net>
Tue, 2 Oct 2018 11:34:05 +0000
(13:34 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 2 Oct 2018 14:11:10 +0000
(16:11 +0200)
src/basic/fileio.c
patch
|
blob
|
history
diff --git
a/src/basic/fileio.c
b/src/basic/fileio.c
index
ea607f8
..
d2fd4c4
100644
(file)
--- a/
src/basic/fileio.c
+++ b/
src/basic/fileio.c
@@
-1492,6
+1492,7
@@
int open_serialization_fd(const char *ident) {
}
int link_tmpfile(int fd, const char *path, const char *target) {
+ int r;
assert(fd >= 0);
assert(target);
@@
-1504,8
+1505,9
@@
int link_tmpfile(int fd, const char *path, const char *target) {
* operation currently (renameat2() does), and there is no nice way to emulate this. */
if (path) {
- if (rename_noreplace(AT_FDCWD, path, AT_FDCWD, target) < 0)
- return -errno;
+ r = rename_noreplace(AT_FDCWD, path, AT_FDCWD, target);
+ if (r < 0)
+ return r;
} else {
char proc_fd_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(fd) + 1];