Rename SAFE_STAT and SAFE_LSTAT to lower case names.
authorJim Meyering <jim@meyering.net>
Fri, 27 Jan 1995 17:03:21 +0000 (17:03 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 27 Jan 1995 17:03:21 +0000 (17:03 +0000)
13 files changed:
src/chgrp.c
src/chmod.c
src/chown.c
src/cp-hash.c
src/cp.c
src/df.c
src/du.c
src/install.c
src/ln.c
src/ls.c
src/mv.c
src/rm.c
src/touch.c

index a60f778..4351281 100644 (file)
@@ -181,7 +181,7 @@ change_file_group (file, group)
   struct stat file_stats;
   int errors = 0;
 
-  if (SAFE_LSTAT (file, &file_stats))
+  if (safe_lstat (file, &file_stats))
     {
       if (force_silent == 0)
        error (0, errno, "%s", file);
index 193ec71..e5a9cea 100644 (file)
@@ -194,7 +194,7 @@ change_file_mode (file, changes, deref_symlink)
   unsigned short newmode;
   int errors = 0;
 
-  if (SAFE_LSTAT (file, &file_stats))
+  if (safe_lstat (file, &file_stats))
     {
       if (force_silent == 0)
        error (0, errno, "%s", file);
@@ -206,7 +206,7 @@ change_file_mode (file, changes, deref_symlink)
       if (! deref_symlink)
        return 0;
       else 
-       if (SAFE_STAT (file, &file_stats))
+       if (safe_stat (file, &file_stats))
          {
            if (force_silent == 0)
              error (0, errno, "%s", file);
index 8e82316..7b0f9b7 100644 (file)
@@ -186,7 +186,7 @@ change_file_owner (file, user, group)
   gid_t newgroup;
   int errors = 0;
 
-  if (SAFE_LSTAT (file, &file_stats))
+  if (safe_lstat (file, &file_stats))
     {
       if (force_silent == 0)
        error (0, errno, "%s", file);
index 92c55a1..4674284 100644 (file)
@@ -37,7 +37,7 @@ remember_created (path)
 {
   struct stat sb;
 
-  if (SAFE_STAT (path, &sb) < 0)
+  if (safe_stat (path, &sb) < 0)
     {
       error (0, errno, "%s", path);
       return 1;
index 462ead2..177a2d3 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -320,7 +320,7 @@ do_copy (argc, argv)
 
   dest = argv[argc - 1];
 
-  if (SAFE_LSTAT (dest, &sb))
+  if (safe_lstat (dest, &sb))
     {
       if (errno != ENOENT)
        {
@@ -337,7 +337,7 @@ do_copy (argc, argv)
       /* If `dest' is not a symlink to a nonexistent file, use
         the results of stat instead of lstat, so we can copy files
         into symlinks to directories. */
-      if (SAFE_STAT (dest, &sbx) == 0)
+      if (safe_stat (dest, &sbx) == 0)
        sb = sbx;
     }
 
@@ -429,7 +429,7 @@ do_copy (argc, argv)
         `cp source dest/' to `cp source dest/basename(source)'.  */
 
       if (dest[strlen (dest) - 1] == '/'
-         && SAFE_LSTAT (source, &source_stats) == 0
+         && safe_lstat (source, &source_stats) == 0
          && !S_ISDIR (source_stats.st_mode))
        {
          char *source_base;
index 6b63c67..7c8425a 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -228,7 +228,7 @@ main (argc, argv)
       stats = (struct stat *)
        xmalloc ((argc - optind) * sizeof (struct stat));
       for (i = optind; i < argc; ++i)
-       if (SAFE_STAT (argv[i], &stats[i - optind]))
+       if (safe_stat (argv[i], &stats[i - optind]))
          {
            error (0, errno, "%s", argv[i]);
            exit_status = 1;
@@ -341,7 +341,7 @@ show_point (point, statp)
     {
       if (me->me_dev == (dev_t) -1)
        {
-         if (SAFE_STAT (me->me_mountdir, &disk_stats) == 0)
+         if (safe_stat (me->me_mountdir, &disk_stats) == 0)
            me->me_dev = disk_stats.st_dev;
          else
            {
index f8161b9..57134f2 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -349,7 +349,7 @@ du_files (files)
   }
 
   /* Remember the inode and device number of the current directory.  */
-  if (SAFE_STAT (".", &stat_buf))
+  if (safe_stat (".", &stat_buf))
     error (1, errno, "current directory");
   initial_ino = stat_buf.st_ino;
   initial_dev = stat_buf.st_dev;
@@ -381,7 +381,7 @@ du_files (files)
       count_entry (arg, 1, 0);
 
       /* chdir if `count_entry' has changed the working directory.  */
-      if (SAFE_STAT (".", &stat_buf))
+      if (safe_stat (".", &stat_buf))
        error (1, errno, ".");
       if (stat_buf.st_ino != initial_ino || stat_buf.st_dev != initial_dev)
        {
@@ -423,7 +423,7 @@ count_entry (ent, top, last_dev)
   long size;
 
   if (((top && opt_dereference_arguments)
-       ? SAFE_STAT (ent, &stat_buf)
+       ? safe_stat (ent, &stat_buf)
        : (*xstat) (ent, &stat_buf)) < 0)
     {
       error (0, errno, "%s", path->text);
index b79e28d..d431bbf 100644 (file)
@@ -321,7 +321,7 @@ copy_file (from, to, to_created)
   struct stat from_stats, to_stats;
   int target_created = 1;
 
-  if (SAFE_STAT (from, &from_stats))
+  if (safe_stat (from, &from_stats))
     {
       error (0, errno, "%s", from);
       return 1;
@@ -331,7 +331,7 @@ copy_file (from, to, to_created)
       error (0, 0, "`%s' is not a regular file", from);
       return 1;
     }
-  if (SAFE_STAT (to, &to_stats) == 0)
+  if (safe_stat (to, &to_stats) == 0)
     {
       if (!S_ISREG (to_stats.st_mode))
        {
index 3bab2cf..96ac765 100644 (file)
--- a/src/ln.c
+++ b/src/ln.c
@@ -226,7 +226,7 @@ main (argc, argv)
         `ln source dest/' to `ln source dest/basename(source)'.  */
 
       if (dest[strlen (dest) - 1] == '/'
-         && SAFE_LSTAT (source, &source_stats) == 0
+         && safe_lstat (source, &source_stats) == 0
          && !S_ISDIR (source_stats.st_mode))
        {
          PATH_BASENAME_CONCAT (new_dest, dest, source);
@@ -274,7 +274,7 @@ do_link (source, dest)
     {
       struct stat source_stats;
 
-      if (SAFE_STAT (source, &source_stats) != 0)
+      if (safe_stat (source, &source_stats) != 0)
        {
          error (0, errno, "%s", source);
          return 1;
@@ -286,7 +286,7 @@ do_link (source, dest)
        }
     }
 
-  if (SAFE_LSTAT (dest, &dest_stats) != 0 && errno != ENOENT)
+  if (safe_lstat (dest, &dest_stats) != 0 && errno != ENOENT)
     {
       error (0, errno, "%s", dest);
       return 1;
@@ -296,7 +296,7 @@ do_link (source, dest)
      and the user has not specified --no-dereference), then form the
      actual destination name by appending basename (source) to the
      specified destination directory.  */
-  lstat_status = SAFE_LSTAT (dest, &dest_stats);
+  lstat_status = safe_lstat (dest, &dest_stats);
 
   if (lstat_status != 0 && errno != ENOENT)
     {
@@ -317,12 +317,12 @@ do_link (source, dest)
       char *new_dest;
       PATH_BASENAME_CONCAT (new_dest, dest, source);
       dest = new_dest;
-      /* Set this to non-zero to force another call to SAFE_LSTAT
+      /* Set this to non-zero to force another call to safe_lstat
         with the new destination.  */
       lstat_status = 1;
     }
 
-  if (lstat_status == 0 || SAFE_LSTAT (dest, &dest_stats) == 0)
+  if (lstat_status == 0 || safe_lstat (dest, &dest_stats) == 0)
     {
       if (S_ISDIR (dest_stats.st_mode))
        {
index 7f04f5c..d4d5055 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -1471,14 +1471,14 @@ gobble_file (name, explicit_arg, dirname)
 
       if (trace_links)
        {
-         val = SAFE_STAT (path, &files[files_index].stat);
+         val = safe_stat (path, &files[files_index].stat);
          if (val < 0)
            /* Perhaps a symbolically-linked to file doesn't exist; stat
               the link instead. */
-           val = SAFE_LSTAT (path, &files[files_index].stat);
+           val = safe_lstat (path, &files[files_index].stat);
        }
       else
-       val = SAFE_LSTAT (path, &files[files_index].stat);
+       val = safe_lstat (path, &files[files_index].stat);
       if (val < 0)
        {
          error (0, errno, "%s", path);
@@ -1501,7 +1501,7 @@ gobble_file (name, explicit_arg, dirname)
          if (linkpath
              && ((explicit_arg && format != long_format)
                  || indicator_style != none || print_with_color)
-             && SAFE_STAT (linkpath, &linkstats) == 0)
+             && safe_stat (linkpath, &linkstats) == 0)
            {
              /* Symbolic links to directories that are mentioned on the
                 command line are automatically traced if not being
index fa0c68e..b343dbf 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -206,7 +206,7 @@ is_real_dir (path)
 {
   struct stat stats;
 
-  return SAFE_LSTAT (path, &stats) == 0 && S_ISDIR (stats.st_mode);
+  return safe_lstat (path, &stats) == 0 && S_ISDIR (stats.st_mode);
 }
 
 /* Move file SOURCE onto DEST.  Handles the case when DEST is a directory.
@@ -248,13 +248,13 @@ do_move (source, dest)
 {
   char *dest_backup = NULL;
 
-  if (SAFE_LSTAT (source, &source_stats) != 0)
+  if (safe_lstat (source, &source_stats) != 0)
     {
       error (0, errno, "%s", source);
       return 1;
     }
 
-  if (SAFE_LSTAT (dest, &dest_stats) == 0)
+  if (safe_lstat (dest, &dest_stats) == 0)
     {
       if (source_stats.st_dev == dest_stats.st_dev
          && source_stats.st_ino == dest_stats.st_ino)
index 871a60d..e8f0bea 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -199,7 +199,7 @@ rm ()
       return 1;
     }
 
-  if (SAFE_LSTAT (pathname, &path_stats))
+  if (safe_lstat (pathname, &path_stats))
     {
       if (errno == ENOENT && ignore_missing_files)
        return 0;
index dc48445..00a2eb4 100644 (file)
@@ -218,7 +218,7 @@ main (argc, argv)
 
   if (use_ref)
     {
-      if (SAFE_STAT (ref_file, &ref_stats))
+      if (safe_stat (ref_file, &ref_stats))
        error (1, errno, "%s", ref_file);
       date_set++;
     }
@@ -263,7 +263,7 @@ touch (file)
   struct stat sbuf;
   int fd;
 
-  if (SAFE_STAT (file, &sbuf))
+  if (safe_stat (file, &sbuf))
     {
       if (errno != ENOENT)
        {