diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 0464df7..8d6cd95 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -2,7 +2,7 @@
  * dos2unix for BusyBox
  *
  * dos2unix '\n' convertor 0.5.0
- *   based on Unix2Dos 0.9.0 by Peter Hanecak (made 19.2.1997)
+ * based on Unix2Dos 0.9.0 by Peter Hanecak (made 19.2.1997)
  * Copyright 1997,.. by Peter Hanecak <hanecak@megaloman.sk>.
  * All rights reserved.
  *
@@ -10,22 +10,8 @@
  * Without arguments it reverts the format (e.i. if source is in UNIX format,
  * output is in DOS format and vice versa).
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * See the COPYING file for license information.
- */
+ *  Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+*/
 
 #include <string.h>
 #include <unistd.h>
@@ -36,55 +22,34 @@
 
 #define CT_UNIX2DOS     1
 #define CT_DOS2UNIX     2
-
-/* We are making a lame pseudo-random string generator here.  in
- * convert(), each pass through the while loop will add more and more
- * stuff into value, which is _supposed_ to wrap.  We don't care about
- * it being accurate.  We care about it being messy, since we use it
- * to pick a random letter to add to out temporary file. */
-typedef unsigned long int bb_uint64_t;
-
 #define tempFn bb_common_bufsiz1
 
 /* if fn is NULL then input is stdin and output is stdout */
 static int convert(char *fn, int ConvType)
 {
 	int c, fd;
-	struct timeval tv;
-	static bb_uint64_t value=0;
 	FILE *in, *out;
 
 	if (fn != NULL) {
 		in = bb_xfopen(fn, "rw");
-		safe_strncpy(tempFn, fn, sizeof(tempFn));
-		c = strlen(tempFn);
-		tempFn[c] = '.';
-		while(1) {
-		    /* tempFn is BUFSIZ so the last addressable spot it BUFSIZ-1.
-		     * The loop increments by 2. So this must check for BUFSIZ-3. */
-		    if (c >=BUFSIZ-3)
-			bb_error_msg_and_die("unique name not found");
-		    /* Get some semi random stuff to try and make a
-		     * random filename based (and in the same dir as)
-		     * the input file... */
-		    gettimeofday (&tv, NULL);
-		    value += ((bb_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
-		    tempFn[++c] = ((value%62) < 26)?(value%62)+97:
-				   ((value%62) < 52)?(value%62)+39:
-				    (value%62)-4;
-		    tempFn[c+1] = '\0';
-		    value /= 62;
-
-		    if ((fd = open(tempFn, O_RDWR | O_CREAT | O_EXCL, 0600)) < 0 ) {
-			continue;
-		    }
-		    out = fdopen(fd, "w+");
-		    if (!out) {
+		/*
+		The file is then created with mode read/write and
+		permissions 0666 for glibc 2.0.6 and earlier or
+		0600  for glibc  2.0.7 and  later. 
+		*/
+		snprintf(tempFn, sizeof(tempFn), "%sXXXXXX", fn);
+		/*
+		sizeof tempFn is 4096, so it should be big enough to hold the full
+		path. however if the output is truncated the subsequent call to
+		mkstemp would fail.
+		*/
+		if ((fd = mkstemp(&tempFn[0])) == -1 || chmod(tempFn, 0600) == -1) {
+			bb_perror_nomsg_and_die();
+		}
+		out = fdopen(fd, "w+");
+		if (!out) {
 			close(fd);
 			remove(tempFn);
-			continue;
-		    }
-		    break;
 		}
 	} else {
 		in = stdin;
@@ -92,37 +57,6 @@
 	}
 
 	while ((c = fgetc(in)) != EOF) {
-		if (c == '\r') {
-			if ((ConvType == CT_UNIX2DOS) && (fn != NULL)) {
-				/* file is already in DOS format so it is
-				 * not necessary to touch it.  */
-				remove(tempFn);
-				if (fclose(in) < 0 || fclose(out) < 0) {
-					bb_perror_nomsg();
-					return -2;
-				}
-				return 0;
-			}
-			break;
-		}
-		if (c == '\n') {
-			if ((ConvType == CT_DOS2UNIX) && (fn != NULL)) {
-				/* file is already in DOS format so it is
-				 * not necessary to touch it.  */
-				remove(tempFn);
-				if ((fclose(in) < 0) || (fclose(out) < 0)) {
-					bb_perror_nomsg();
-					return -2;
-				}
-				return 0;
-			}
-			if (ConvType == CT_UNIX2DOS) {
-				fputc('\r', out);
-			}
-		}
-		fputc(c, out);
-	}
-	while (c != EOF && (c = fgetc(in)) != EOF) {
 		if (c == '\r')
 			continue;
 		if (c == '\n') {
@@ -135,18 +69,18 @@
 	}
 
 	if (fn != NULL) {
-	    if (fclose(in) < 0 || fclose(out) < 0) {
-		bb_perror_nomsg();
-		remove(tempFn);
-		return -2;
+		if (fclose(in) < 0 || fclose(out) < 0) {
+			bb_perror_nomsg();
+			remove(tempFn);
+			return -2;
 	    }
-
-	    /* Assume they are both on the same filesystem (which
-	     * should be true since we put them into the same directory
-	     * so we _should_ be ok, but you never know... */
-	    if (rename(tempFn, fn) < 0) {
-		bb_perror_msg("unable to rename '%s' as '%s'", tempFn, fn);
-		return -1;
+	
+		/* Assume they are both on the same filesystem (which
+		* should be true since we put them into the same directory
+		* so we _should_ be ok, but you never know... */
+		if (rename(tempFn, fn) < 0) {
+			bb_perror_msg("cannot rename '%s' as '%s'", tempFn, fn);
+			return -1;
 	    }
 	}
 
@@ -160,13 +94,16 @@
 
 	/* See if we are supposed to be doing dos2unix or unix2dos */
 	if (argv[0][0]=='d') {
-	    ConvType = CT_DOS2UNIX;
+	    ConvType = CT_DOS2UNIX;  /*1*/
 	} else {
-	    ConvType = CT_UNIX2DOS;
+	    ConvType = CT_UNIX2DOS;  /*2*/
 	}
-
+	/* -u and -d are mutally exclusive */
+	bb_opt_complementally = "?:u--d:d--u";
 	/* process parameters */
-	o = bb_getopt_ulflags(argc, argv, "ud");
+	/* -u convert to unix */
+	/* -d convert to dos  */
+	o = bb_getopt_ulflags(argc, argv, "du");
 
 	/* Do the conversion requested by an argument else do the default
 	 * conversion depending on our name.  */
@@ -183,4 +120,3 @@
 
 	return o;
 }
-
