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.
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
delayed_ok = false;
}
}
-#ifdef S_ISLNK
else if (x->symbolic_link)
{
preserve_metadata = false;
goto un_backup;
}
}
-#endif
else if (x->hard_link
#ifdef LINK_FOLLOWS_SYMLINKS
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))
{
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))
{
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)
{
/* 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))
{
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;
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':
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)
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. */
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 `././././. ...' */
{NULL, 0, NULL, 0}
};
-#ifdef S_ISFIFO
void
usage (int status)
{
}
exit (status);
}
-#endif
int
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)
}
exit (exit_status);
-#endif
}
/* 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
# 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