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:
43b1f70
)
mkdir: chmod_and_chown() returns errors as "return -errno", not in errno itself
author
Lennart Poettering
<lennart@poettering.net>
Wed, 9 Aug 2017 10:46:09 +0000
(12:46 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 10 Aug 2017 13:02:50 +0000
(15:02 +0200)
src/basic/mkdir.c
patch
|
blob
|
history
diff --git
a/src/basic/mkdir.c
b/src/basic/mkdir.c
index
6b1a984
..
7db09fc
100644
(file)
--- a/
src/basic/mkdir.c
+++ b/
src/basic/mkdir.c
@@
-31,10
+31,13
@@
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) {
struct stat st;
+ int r;
- if (_mkdir(path, mode) >= 0)
- if (chmod_and_chown(path, mode, uid, gid) < 0)
- return -errno;
+ if (_mkdir(path, mode) >= 0) {
+ r = chmod_and_chown(path, mode, uid, gid);
+ if (r < 0)
+ return r;
+ }
if (lstat(path, &st) < 0)
return -errno;