* src/copy.c (copy_internal): Don't test whether macros like

S_ISLNK are defined, since they're always defined now.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/ls.c (get_link_name, make_link_name): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/who.c (S_IWGRP): Likewise.
This commit is contained in:
Paul Eggert committed 2006-08-28 23:29:38 +00:00
1 parent 023c88aaa0
commit 25aebae77d
7 files changed
+15 -41

No files matched your search

+8
View File
@@ -1,5 +1,13 @@
2006-08-28 Paul Eggert <eggert@cs.ucla.edu>
* src/copy.c (copy_internal): Don't test whether macros like
S_ISLNK are defined, since they're always defined now.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/ls.c (get_link_name, make_link_name): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/who.c (S_IWGRP): Likewise.
Adjust to recent gnulib changes for the gnulib module.
* bootstrap.conf (gnulib_modules): Add fcntl.
* src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove. Other code
+6 -16
View File
@@ -1558,7 +1558,6 @@ copy_internal (char const *src_name, char const *dst_name,
delayed_ok = false;
}
}
#ifdef S_ISLNK
else if (x->symbolic_link)
{
preserve_metadata = false;
@@ -1597,7 +1596,6 @@ copy_internal (char const *src_name, char const *dst_name,
goto un_backup;
}
}
#endif
else if (x->hard_link
#ifdef LINK_FOLLOWS_SYMLINKS
@@ -1632,9 +1630,7 @@ copy_internal (char const *src_name, char const *dst_name,
if (! copy_reg (src_name, dst_name, x, src_mode, &new_dst, &src_sb))
goto un_backup;
}
else
#ifdef S_ISFIFO
if (S_ISFIFO (src_type))
else if (S_ISFIFO (src_type))
{
if (mkfifo (dst_name, src_mode))
{
@@ -1642,10 +1638,7 @@ copy_internal (char const *src_name, char const *dst_name,
goto un_backup;
}
}
else
#endif
if (S_ISBLK (src_type) || S_ISCHR (src_type)
|| S_ISSOCK (src_type))
else if (S_ISBLK (src_type) || S_ISCHR (src_type) || S_ISSOCK (src_type))
{
if (mknod (dst_name, src_mode, src_sb.st_rdev))
{
@@ -1654,9 +1647,7 @@ copy_internal (char const *src_name, char const *dst_name,
goto un_backup;
}
}
else
#ifdef S_ISLNK
if (S_ISLNK (src_type))
else if (S_ISLNK (src_type))
{
char *src_link_val = xreadlink (src_name, src_sb.st_size);
if (src_link_val == NULL)
@@ -1700,7 +1691,7 @@ copy_internal (char const *src_name, char const *dst_name,
{
/* Preserve the owner and group of the just-`copied'
symbolic link, if possible. */
# if HAVE_LCHOWN
#if HAVE_LCHOWN
if (lchown (dst_name, src_sb.st_uid, src_sb.st_gid) != 0
&& ! chown_failure_ok (x))
{
@@ -1708,16 +1699,15 @@ copy_internal (char const *src_name, char const *dst_name,
dst_name);
goto un_backup;
}
# else
#else
/* Can't preserve ownership of symlinks.
FIXME: maybe give a warning or even error for symlinks
in directories with the sticky bit set -- there, not
preserving owner/group is a potential security problem. */
# endif
#endif
}
}
else
#endif
{
error (0, 0, _("%s has unknown file type"), quote (src_name));
goto un_backup;
-5
View File
@@ -957,12 +957,7 @@ main (int argc, char **argv)
break;
case 's':
#ifdef S_ISLNK
x.symbolic_link = true;
#else
error (EXIT_FAILURE, 0,
_("symbolic links are not supported on this system"));
#endif
break;
case 't':
-5
View File
@@ -428,12 +428,7 @@ main (int argc, char **argv)
dereference_dest_dir_symlinks = false;
break;
case 's':
#ifdef S_ISLNK
symbolic_link = true;
#else
error (EXIT_FAILURE, 0,
_("symbolic links are not supported on this system"));
#endif
break;
case 't':
if (target_directory)
-4
View File
@@ -2760,9 +2760,6 @@ is_directory (const struct fileinfo *f)
return f->filetype == directory || f->filetype == arg_directory;
}
#ifdef S_ISLNK
/* Put the name of the file that FILENAME is a symbolic link to
into the LINKNAME field of `f'. COMMAND_LINE_ARG indicates whether
FILENAME is a command-line argument. */
@@ -2805,7 +2802,6 @@ make_link_name (char const *name, char const *linkname)
strcpy (linkbuf + bufsiz, linkname);
return linkbuf;
}
#endif
/* Return true if the last component of NAME is `.' or `..'
This is so we don't try to recurse on `././././. ...' */
-6
View File
@@ -43,7 +43,6 @@ static struct option const longopts[] =
{NULL, 0, NULL, 0}
};
#ifdef S_ISFIFO
void
usage (int status)
{
@@ -69,7 +68,6 @@ Mandatory arguments to long options are mandatory for short options too.\n\
}
exit (status);
}
#endif
int
main (int argc, char **argv)
@@ -87,9 +85,6 @@ main (int argc, char **argv)
atexit (close_stdout);
#ifndef S_ISFIFO
error (EXIT_FAILURE, 0, _("fifo files not supported"));
#else
while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1)
{
switch (optc)
@@ -131,5 +126,4 @@ main (int argc, char **argv)
}
exit (exit_status);
#endif
}
+1 -5
View File
@@ -1,5 +1,5 @@
/* GNU's who.
Copyright (C) 1992-2005 Free Software Foundation, Inc.
Copyright (C) 1992-2006 Free Software Foundation, Inc.
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
@@ -48,10 +48,6 @@
# define MAXHOSTNAMELEN 64
#endif
#ifndef S_IWGRP
# define S_IWGRP 020
#endif
#ifdef RUN_LVL
# define UT_TYPE_RUN_LVL(U) UT_TYPE_EQ (U, RUN_LVL)
#else