devfs
[Top] [All Lists]

[PATCH] Use mksymlink in the sample devfsd.conf

To: devfs@xxxxxxxxxxx
Subject: [PATCH] Use mksymlink in the sample devfsd.conf
From: Pavel Roskin <proski@xxxxxxx>
Date: Thu, 20 Dec 2001 19:12:49 -0500 (EST)
Sender: owner-devfs@xxxxxxxxxxx
Hello!

The file devfsd.conf included with devfsd-1.3.19 used symlink() whereas 
the manual recommends using mksymlink().  Here's the patch:

=========================
--- devfsd.conf
+++ devfsd.conf
@@ -38,6 +38,6 @@
 # Uncomment this if you want the old /dev/cdrom symlink
 # (e.g. those specifying CD-ROM type, mouse port, modem port etc)
 #
-#LOOKUP                ^cdrom$         CFUNCTION GLOBAL symlink cdroms/cdrom0 
$devpath
-#REGISTER      ^cdrom/cdrom0$  CFUNCTION GLOBAL symlink cdroms/cdrom0 cdrom
+#LOOKUP                ^cdrom$         CFUNCTION GLOBAL mksymlink 
cdroms/cdrom0 $devpath
+#REGISTER      ^cdrom/cdrom0$  CFUNCTION GLOBAL mksymlink cdroms/cdrom0 cdrom
 #UNREGISTER    ^cdrom/cdrom0$  CFUNCTION GLOBAL unlink cdrom
=========================

By the way, CFUNCTION doesn't work if devfsd is statically linked.  This
may be a serious limitation for some embedded configurations.  I also can
imagine that some sysadmins would want to link some basic utilities
statically to survive possible libc problems.

What if we implement mksymlink and unlink as separate actions, like COPY?  
These are very basic operations that most people need.

-- 
Regards,
Pavel Roskin


<Prev in Thread] Current Thread [Next in Thread>