[systemd-commits] 2 commits - docs/gudev docs/libudev src/shared src/tmpfiles
Lennart Poettering
lennart at kemper.freedesktop.org
Tue May 15 05:36:03 PDT 2012
docs/gudev/Makefile.am | 2 +-
docs/libudev/Makefile.am | 2 +-
src/shared/util.c | 3 ++-
src/tmpfiles/tmpfiles.c | 9 +++++++--
4 files changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 03ad1136ba6ddaeca626aa24362dab764c7e2398
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue May 15 14:34:33 2012 +0200
tmpfiles: if we are supposed to write a string to a file, it's OK if we can't write the trailing newline
diff --git a/src/shared/util.c b/src/shared/util.c
index d6af927..0b81e1c 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -597,7 +597,8 @@ int write_one_line_file(const char *fn, const char *line) {
assert(fn);
assert(line);
- if (!(f = fopen(fn, "we")))
+ f = fopen(fn, "we");
+ if (!f)
return -errno;
errno = 0;
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 2356178..2ee0601 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -617,8 +617,13 @@ static int create_item(Item *i) {
iovec[1].iov_len = 1;
n = writev(fd, iovec, 2);
- if (n < 0 || (size_t) n != l+1) {
- log_error("Failed to write file %s: %s", i->path, n < 0 ? strerror(-n) : "Short");
+
+ /* It's OK if we don't write the trailing
+ * newline, hence we check for l, instead of
+ * l+1 here. Files in /sys often refuse
+ * writing of the trailing newline. */
+ if (n < 0 || (size_t) n < l) {
+ log_error("Failed to write file %s: %s", i->path, n < 0 ? strerror(-n) : "Short write");
close_nointr_nofail(fd);
return n < 0 ? n : -EIO;
}
commit 04fb63514d1c98fdf9c9549639a1f6d9812444ac
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue May 15 14:34:06 2012 +0200
build-sys: fix build
diff --git a/docs/gudev/Makefile.am b/docs/gudev/Makefile.am
index a592afa..586dd8d 100644
--- a/docs/gudev/Makefile.am
+++ b/docs/gudev/Makefile.am
@@ -87,7 +87,7 @@ GTKDOC_LIBS = \
$(top_builddir)/libgudev-1.0.la
# This includes the standard gtk-doc make rules, copied by gtkdocize.
-include $(top_srcdir)/gtk-doc.make
+include $(top_srcdir)/docs/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
diff --git a/docs/libudev/Makefile.am b/docs/libudev/Makefile.am
index 4f0d196..f9365b3 100644
--- a/docs/libudev/Makefile.am
+++ b/docs/libudev/Makefile.am
@@ -81,7 +81,7 @@ GTKDOC_CFLAGS=
GTKDOC_LIBS=
# This includes the standard gtk-doc make rules, copied by gtkdocize.
-include $(top_srcdir)/gtk-doc.make
+include $(top_srcdir)/docs/gtk-doc.make
# Other files to distribute
# e.g. EXTRA_DIST += version.xml.in
More information about the systemd-commits
mailing list