Age | Commit message (Collapse) | Author |
|
|
|
|
|
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards.
|
|
In other parts of systemd, the code checks for " (deleted)",
but in one instance, it did not (yet). Make it do the same.
|
|
Always use cleanup logic and don't eat up errors returned by libudev
|
|
each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use.
|
|
|
|
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
|
|
|
|
Before, we would initialize many fields twice: first
by filling the structure with zeros, and then a second
time with the real values. We can let the compiler do
the job for us, avoiding one copy.
A downside of this patch is that text gets slightly
bigger. This is because all zero() calls are effectively
inlined:
$ size build/.libs/systemd
text data bss dec hex filename
before 897737 107300 2560 1007597 f5fed build/.libs/systemd
after 897873 107300 2560 1007733 f6075 build/.libs/systemd
… actually less than 1‰.
A few asserts that the parameter is not null had to be removed. I
don't think this changes much, because first, it is quite unlikely
for the assert to fail, and second, an immediate SEGV is almost as
good as an assert.
|
|
Use _cleanup_ and wrap lines to ~80 chars and such.
|
|
|
|
|
|
MNT_FORCE is honoured by NFS and FUSE and allows unmounting of the FS
even if consumers still use it. For our brute-force loop we rely on
EBUSY being reported as long as a file system is still used by a
loopback device or suchlike. Hence, drop MNT_FORCE to make EBUSY
reliable.
|
|
Mounts are "unmounted".
Swaps are "deactivated", not "turned off" nor "disabled".
Loop and DM devices are "detached", not "deleted".
Especially the deleting sounded a bit scary.
|
|
In bugreports about hangs during the late shutdown we are often missing
important information - what were we trying to unmount/detach when it hung.
Instead of printing what we successfully unmounted, print what we are
going to unmount/detach. And add messages to mark the completion of
categories (mount/swap/loop/DM).
|
|
delete_dm() returns 0 on success. The check for "r > 0" was likely
a copy&paste error from the loopback code where "r > 0" makes sense.
|
|
|
|
In the words of Homer: If you don't try, you can't fail.
This is a revert of 9279749b84cc87c7830280b7895a48bed03c9429.
It used to be necessary to consider the umounting failed to make sure /
and /usr were remounted read-only, but that is no longer necessary as
everything is now remounted read-only anyway.
Moreover, this avoids a warning at shutdown saying a filesystem was not
unmounted. As the umounting of / is never attempted there was no
corresponding warning message saying which fs that failed. This caused some
spurious bug-reports from concerned users.
Cc: Michael Biebl <biebl@debian.org>
|
|
|
|
|
|
|
|
This reverts commits d72238fcb34abc81aca97c5fb15888708ee937d3 and
f3accc08.
OLPC runs / as a bind-mount, so this must be remounted RO during
shutdown to avoid corruption.
As Lennert can't recall the exact reasons for making the shutdown
code skip bind mounts, revert to previous behaviour to solve the
issue for OLPC.
http://lists.freedesktop.org/archives/systemd-devel/2012-April/004957.html
|
|
|
|
|