File sash-3.7-raid.diff of Package sash

--- sash.c
+++ sash.c
@@ -14,6 +14,9 @@
 
 #include "sash.h"
 
+#include <sys/ioctl.h>
+#include <linux/major.h>
+#include <linux/raid/md_u.h>
 
 static const char * const	version = "3.7";
 
@@ -340,6 +343,12 @@
 	},
 
 	{
+		"raidautorun",		do_raidautorun,	1,	1,
+		"Configure RAID devices",
+		""
+	},
+
+	{
 		NULL,		0,		0,	0,
 		NULL,
 		NULL
@@ -1221,6 +1230,18 @@
 }
 
 
+void
+do_raidautorun(int argc, const char ** argv)
+{
+  int fd = open("/dev/md0", O_RDWR);
+
+  if(fd >= 0) {
+    ioctl(fd , RAID_AUTORUN, 0);
+    close(fd);
+  }
+}
+
+
 /*
  * Display the prompt string.
  */
--- sash.h
+++ sash.h
@@ -99,6 +99,7 @@
 extern	void	do_find(int argc, const char ** argv);
 extern	void	do_ed(int argc, const char ** argv);
 extern	void	do_where(int argc, const char ** argv);
+extern	void	do_raidautorun(int argc, const char ** argv);
 
 #if	HAVE_GZIP
 extern	void	do_gzip(int argc, const char ** argv);
openSUSE Build Service is sponsored by