chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-rtnl: message - add support for getting prefixlen from address messages
[elogind.git]
/
src
/
tmpfiles
/
tmpfiles.c
diff --git
a/src/tmpfiles/tmpfiles.c
b/src/tmpfiles/tmpfiles.c
index 74a01271e9ed3777ebfc9e9a8010cf32735c1177..04b472da97e58315769c0cb31c9323a1520f6f63 100644
(file)
--- a/
src/tmpfiles/tmpfiles.c
+++ b/
src/tmpfiles/tmpfiles.c
@@
-217,19
+217,16
@@
static bool unix_socket_alive(const char *fn) {
}
static int dir_is_mount_point(DIR *d, const char *subdir) {
}
static int dir_is_mount_point(DIR *d, const char *subdir) {
-
struct file_handle *h
;
+
union file_handle_union h = { .handle.handle_bytes = MAX_HANDLE_SZ }
;
int mount_id_parent, mount_id;
int r_p, r;
int mount_id_parent, mount_id;
int r_p, r;
- h = alloca(MAX_HANDLE_SZ);
-
- h->handle_bytes = MAX_HANDLE_SZ;
- r_p = name_to_handle_at(dirfd(d), ".", h, &mount_id_parent, 0);
+ r_p = name_to_handle_at(dirfd(d), ".", &h.handle, &mount_id_parent, 0);
if (r_p < 0)
r_p = -errno;
if (r_p < 0)
r_p = -errno;
- h
->
handle_bytes = MAX_HANDLE_SZ;
- r = name_to_handle_at(dirfd(d), subdir,
h
, &mount_id, 0);
+ h
.handle.
handle_bytes = MAX_HANDLE_SZ;
+ r = name_to_handle_at(dirfd(d), subdir,
&h.handle
, &mount_id, 0);
if (r < 0)
r = -errno;
if (r < 0)
r = -errno;
@@
-496,7
+493,7
@@
static int write_one_file(Item *i, const char *path) {
unescaped = cunescape(i->argument);
if (unescaped == NULL) {
unescaped = cunescape(i->argument);
if (unescaped == NULL) {
-
close_nointr_nofail
(fd);
+
safe_close
(fd);
return log_oom();
}
return log_oom();
}
@@
-505,12
+502,12
@@
static int write_one_file(Item *i, const char *path) {
if (n < 0 || (size_t) n < l) {
log_error("Failed to write file %s: %s", path, n < 0 ? strerror(-n) : "Short write");
if (n < 0 || (size_t) n < l) {
log_error("Failed to write file %s: %s", path, n < 0 ? strerror(-n) : "Short write");
-
close_nointr_nofail
(fd);
+
safe_close
(fd);
return n < 0 ? n : -EIO;
}
}
return n < 0 ? n : -EIO;
}
}
-
close_nointr_nofail
(fd);
+
safe_close
(fd);
if (stat(path, &st) < 0) {
log_error("stat(%s) failed: %m", path);
if (stat(path, &st) < 0) {
log_error("stat(%s) failed: %m", path);