[PATCH 8/8] silence complaint from mknod-stub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$Id: patch8.in /main/4 2009/07/10 17:42:52 alfords Exp $
Copyright 2009 Automatic Data Processing Inc.  

See the README file in the first patch of this series for
important details.

We had to modify mknod-stub.patch.  As I recall, it was somehow
getting called twice.  That led it to complain that the device
node already existed.  The patch silences the complaint, but only
for the case where the node already exists, with the right major
and minor numbers, device type (character or block,) and modes.
Otherwise, mknod-stub will still complain.

--Seth Alford
ADP Dealer Services
seth_alford@xxxxxxx

----mknod-stub.patch follows----
--- a_naconda-11.1.2.168/command-stubs/mknod-stub	2008-12-18 02:21:19.000000000 -0800
+++ anaconda-11.1.2.168/command-stubs/mknod-stub	2009-05-12 15:22:36.000000000 -0700
@@ -6,6 +6,7 @@
 import string
 import stat
 import os
+import errno
 
 def usage():
     sys.stderr.write("Usage: %s <path> [b|c] <major> <minor> or\n" %(sys.argv[0],))
@@ -48,7 +49,18 @@
     minor = int(sys.argv[4])
     path = sys.argv[1]
     
-    os.mknod(path, 0644 | type, os.makedev(major, minor))
+    try:
+        os.mknod(path, 0644 | type, os.makedev(major, minor))
+    except OSError, e:
+        statbuf = os.stat(path)
+    	if (errno.errorcode[e.errno] == "EEXIST" and
+            os.major(statbuf.st_rdev) == major and
+	    os.minor(statbuf.st_rdev) == minor and
+	    ((type == stat.S_IFCHR and stat.S_ISCHR(statbuf.st_mode)) or
+	     (type == stat.S_IFBLK and stat.S_ISBLK(statbuf.st_mode)))):
+	    pass
+	else:
+            raise OSError, e
 
 if __name__ == "__main__":
     main()


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux