]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
.
authorJim Meyering <jim@meyering.net>
Thu, 27 Oct 1994 04:18:00 +0000 (04:18 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 27 Oct 1994 04:18:00 +0000 (04:18 +0000)
src/cp.c
src/df.c

index 3ba38f5aacd3aadf8488a3f387ef79865c570fe6..cb4f3fe283a2c216840e099f05c503089a388a3c 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -951,11 +951,6 @@ make_path (const_dirpath, src_offset, mode, verbose_fmt_string,
       error (0, 0, "`%s' exists but is not a directory", dst_dirname);
       return 1;
     }
-  else if (chmod (dst_dirname, mode))
-    {
-      error (0, errno, "%s", dst_dirname);
-      return 1;
-    }
   else
     {
       *new_dst = 0;
index 23be53140fa9b2dc8d5ad670e47ecbef9a79795c..2145bfa41318ded2045b85da242c5b1f12deab2b 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -79,6 +79,10 @@ static int kilobyte_blocks;
 /* If nonzero, use the POSIX output format.  */
 static int posix_format;
 
+/* If nonzero, invoke the `sync' system call.  Using this option
+   can make df very slow, especially with many or very busy disks.  */
+static int require_sync;
+
 /* Nonzero if errors have occurred. */
 static int exit_status;
 
@@ -127,6 +131,7 @@ static struct option const long_options[] =
   {"kilobytes", no_argument, &kilobyte_blocks, 1},
   {"portability", no_argument, &posix_format, 1},
   {"print-type", no_argument, &print_type, 1},
+  {"sync", no_argument, 0, 's'},
   {"type", required_argument, 0, 't'},
   {"exclude-type", required_argument, 0, 'x'},
   {"help", no_argument, &show_help, 1},
@@ -175,6 +180,9 @@ main (argc, argv)
        case 'P':
          posix_format = 1;
          break;
+       case 's':
+         require_sync = 1;
+         break;
        case 't':
          add_fs_type (optarg);
          break;
@@ -227,7 +235,8 @@ main (argc, argv)
     error (1, errno, "cannot read table of mounted filesystems");
 
   print_header ();
-  sync ();
+  if (require_sync)
+    sync ();
 
   if (optind == argc)
     show_all_entries ();
@@ -505,6 +514,7 @@ usage (status)
   -a, --all                 include filesystems having 0 blocks\n\
   -i, --inodes              list inode information instead of block usage\n\
   -k, --kilobytes           use 1024 blocks, not 512 despite POSIXLY_CORRECT\n\
+  -s, --sync                invoke sync system call before getting usage info\n\
   -t, --type=TYPE           limit the listing to TYPE filesystems type\n\
   -x, --exclude-type=TYPE   limit the listing to not TYPE filesystems type\n\
   -v                        (ignored)\n\