]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/misc-progs/iowrap.c
installer: Don't try to install /etc/hosts which does not exist
[ipfire-2.x.git] / src / misc-progs / iowrap.c
index e56203e27faab22dd237ead67991a2502657e751..115ec2a06373359262a6b992b7a77f22d3370798 100644 (file)
@@ -1,44 +1,44 @@
-/* SmoothWall helper program - iowrap.\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * Installer helper for redirecting stdout/stderr to a file/terminal.\r
- * init calls ash through this program to shove it on a tty.\r
- * \r
- * $Id: iowrap.c,v 1.2 2001/11/27 15:20:50 riddles Exp $\r
- * \r
- */\r
-\r
-#include <stdio.h>\r
-#include <sys/types.h>\r
-#include <sys/stat.h>\r
-#include <fcntl.h>\r
-#include <unistd.h>\r
-\r
-int main(int argc, char *argv[])\r
-{\r
-       /* Prog takes one argument.  A device to run on (like a getty) */\r
-       if (argc >= 2)\r
-       {\r
-               int fd;\r
-               \r
-               if ((fd = open(argv[1], O_RDWR)) == -1)\r
-               {\r
-                       printf("Couldn't open device\n");\r
-                       return 0;\r
-               }\r
-               dup2(fd, 0);\r
-               dup2(fd, 1);\r
-               dup2(fd, 2);\r
-               /* Now its sending/reading on that device. */\r
-       }\r
-       \r
-       if (argc >= 3)  \r
-               execvp(argv[2], &argv[2]);\r
-       else\r
-               printf("No command\n");\r
-\r
-       return 0;\r
-}\r
+/* SmoothWall helper program - iowrap.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * Installer helper for redirecting stdout/stderr to a file/terminal.
+ * init calls ash through this program to shove it on a tty.
+ * 
+ * $Id: iowrap.c,v 1.2 2001/11/27 15:20:50 riddles Exp $
+ * 
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+       /* Prog takes one argument.  A device to run on (like a getty) */
+       if (argc >= 2)
+       {
+               int fd;
+               
+               if ((fd = open(argv[1], O_RDWR)) == -1)
+               {
+                       printf("Couldn't open device\n");
+                       return 0;
+               }
+               dup2(fd, 0);
+               dup2(fd, 1);
+               dup2(fd, 2);
+               /* Now its sending/reading on that device. */
+       }
+       
+       if (argc >= 3)  
+               execvp(argv[2], &argv[2]);
+       else
+               printf("No command\n");
+
+       return 0;
+}