summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-17 22:43:10 +0000
committerJim Meyering <jim@meyering.net>1993-10-17 22:43:10 +0000
commit214c19a8b32d2ed5dd3b0b57eea84c709720c753 (patch)
tree9ed7bb495b774417c7f9738e208e532a7969004d
parent1958250cc66bf2ec89193bff8b27b73ce5765fc7 (diff)
downloadcoreutils-214c19a8b32d2ed5dd3b0b57eea84c709720c753.tar.xz
merge with 3.8.4g
-rw-r--r--lib/Makefile.in2
-rw-r--r--old/fileutils/ChangeLog15
-rw-r--r--old/fileutils/NEWS2
-rw-r--r--src/chmod.c21
-rw-r--r--src/ls.c4
5 files changed, 35 insertions, 9 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 8728ebdba..d80dee4f4 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -109,7 +109,7 @@ rename.o: rename.c
$(CC) -c $(CPPFLAGS) -DMVDIR="\"$(libdir)/mvdir\"" $(DEFS) \
-I.. -I$(srcdir) $(CFLAGS) $(srcdir)/rename.c
-$(OBJECTS): $(srcdir)/../config.h
+$(OBJECTS): ../config.h
backupfile.o getversion.o: backupfile.h
fnmatch.o: fnmatch.h
diff --git a/old/fileutils/ChangeLog b/old/fileutils/ChangeLog
index cbb71a9bf..160ab77d4 100644
--- a/old/fileutils/ChangeLog
+++ b/old/fileutils/ChangeLog
@@ -1,3 +1,18 @@
+Sun Oct 17 00:19:58 1993 Jim Meyering (meyering@comco.com)
+
+ * ls.c (print_long_format): Cast printf args major and minor
+ so they'll have types macthing %u format even on systems
+ where those macros have signed type.
+
+Sat Oct 16 00:25:42 1993 Jim Meyering (meyering@comco.com)
+
+ * chmod.c (change_file_mode): Reapply Oct 6 change for symlinks.
+ Somehow it got removed from working sources.
+
+ * lib/Makefile.in [OBJECTS]: Change dependency to ../config.h so
+ it works when building in a subdirectory. From Rick Sladkey
+ (jrs@world.std.com).
+
Wed Oct 13 19:43:47 1993 Jim Meyering (meyering@comco.com)
* cp.c (copy), ls.c (get_link_name): Complete Aug 27 change so
diff --git a/old/fileutils/NEWS b/old/fileutils/NEWS
index 831704f43..35c9b3554 100644
--- a/old/fileutils/NEWS
+++ b/old/fileutils/NEWS
@@ -1,5 +1,5 @@
Major changes in release 3.9:
-* --help gives one-line description of options and shows correspondence
+* --help gives one-line description of each option and shows correspondence
between short and long-named options.
* GNU chmod treats symlinks the same way other vendor's versions do.
Now symlinks listed on the command line are processed (they were
diff --git a/src/chmod.c b/src/chmod.c
index f1e4738ff..5236cb140 100644
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -176,18 +176,21 @@ main (argc, argv)
error (1, 0, "virtual memory exhausted");
for (; optind < argc; ++optind)
- errors |= change_file_mode (argv[optind], changes);
+ errors |= change_file_mode (argv[optind], changes, 1);
exit (errors);
}
/* Change the mode of FILE according to the list of operations CHANGES.
- Return 0 if successful, 1 if errors occurred. */
+ If DEREF_SYMLINK is non-zero and FILE is a symbolic link, change the
+ mode of the referenced file. If DEREF_SYMLINK is zero, ignore symbolic
+ links. Return 0 if successful, 1 if errors occurred. */
static int
-change_file_mode (file, changes)
+change_file_mode (file, changes, deref_symlink)
char *file;
struct mode_change *changes;
+ int deref_symlink;
{
struct stat file_stats;
unsigned short newmode;
@@ -201,7 +204,15 @@ change_file_mode (file, changes)
}
#ifdef S_ISLNK
if (S_ISLNK (file_stats.st_mode))
- return 0;
+ if (! deref_symlink)
+ return 0;
+ else
+ if (stat (file, &file_stats))
+ {
+ if (force_silent == 0)
+ error (0, errno, "%s", file);
+ return 1;
+ }
#endif
newmode = mode_adjust (file_stats.st_mode, changes);
@@ -273,7 +284,7 @@ change_dir_mode (dir, changes, statp)
path = xrealloc (path, pathlength);
}
strcpy (path + dirlength, namep);
- errors |= change_file_mode (path, changes);
+ errors |= change_file_mode (path, changes, 0);
}
free (path);
free (name_space);
diff --git a/src/ls.c b/src/ls.c
index e42d423c2..16827f71f 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -1477,8 +1477,8 @@ print_long_format (f)
}
if (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode))
- printf ("%3u, %3u ", major (f->stat.st_rdev),
- minor (f->stat.st_rdev));
+ printf ("%3u, %3u ", (unsigned) major (f->stat.st_rdev),
+ (unsigned) minor (f->stat.st_rdev));
else
printf ("%8lu ", f->stat.st_size);