* archival/bunzip2.c (bunzip2_main): Do not remove files if writing to standard
[oweals/busybox.git] / coreutils / tee.c
index 439cf7dc5ea7569b9cef02a3379ec903c63f1499..1c145426a166c0e796b5dc2cd7f23249d3d051ef 100644 (file)
@@ -2,8 +2,7 @@
 /*
  * Mini tee implementation for busybox
  *
- * Copyright (C) 1999,2000,2001 by Lineo, inc.
- * Written by Matt Kraai <kraai@alumni.carnegiemellon.edu>
+ * Copyright (C) 2000,2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
  *
  * 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
@@ -45,9 +44,8 @@ tee_main(int argc, char **argv)
        files = (FILE **)xmalloc(sizeof(FILE *) * (argc - optind + 1));
        files[nfiles++] = stdout;
        while (optind < argc) {
-               if ((files[nfiles++] = fopen(argv[optind++], mode)) == NULL) {
+               if ((files[nfiles++] = wfopen(argv[optind++], mode)) == NULL) {
                        nfiles--;
-                       perror_msg("%s", argv[optind-1]);
                        status = 1;
                }
        }