Date: Mon, 1 Aug 2005 23:37:05 -0500 (CDT) From: diz@linuxpowered.com To: freebsd-hackers@freebsd.org Subject: [patch] rc.d/tmp (silly mkdir usage) Message-ID: <51934.68.95.232.238.1122957425.squirrel@68.95.232.238>
next in thread | raw e-mail | index | archive | help
Howdy hackers,
I'm sorry for the previous patch, so here is at least one item that really
bugs me that isn't obfuscation. In short, I don't see any reason to fork
some process to simply "touch" a file (is a filesystem writable) when
built-in shell i/o does this:
--- /etc/rc.d/tmp.orig Mon Aug 1 23:20:24 2005
+++ /etc/rc.d/tmp Mon Aug 1 23:22:07 2005
@@ -48,8 +48,8 @@
[Nn][Oo])
;;
*)
- if (/bin/mkdir -p /tmp/.diskless 2> /dev/null); then
- rmdir /tmp/.diskless
+ if ( > /tmp/.diskless 2> /dev/null); then
+ rm /tmp/.diskless
else
if [ -h /tmp ]; then
echo "*** /tmp is a symlink to a non-writable area!"
I grep'ed the entire rc.d dir, and found that the same technique is used
elsewhere in accounting, and cleanvar. So I feel justified this time,
although please review, and thanks for the look. While I understand the
need to want a fork program to touch, or otherwise create an inode, I feel
forking for such an effort is weird and a bit over-engineered.
-Jon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51934.68.95.232.238.1122957425.squirrel>
