[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix for ln.c porting bug on HP Nonstop
From: |
Paul Eggert |
Subject: |
fix for ln.c porting bug on HP Nonstop |
Date: |
Tue, 19 Sep 2006 15:13:11 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
I installed this:
2006-09-19 Paul Eggert <address@hidden>
* src/ln.c (target_directory_operand): Rewrite to avoid porting
problem on Tandem reported by Matthew Woehlke in
<https://savannah.gnu.org/bugs/?17172>.
--- src/ln.c.~1.160.~ 2006-09-02 19:53:16.000000000 -0700
+++ src/ln.c 2006-09-19 15:07:08.000000000 -0700
@@ -112,8 +112,9 @@ target_directory_operand (char const *fi
size_t blen = strlen (b);
bool looks_like_a_dir = (blen == 0 || ISSLASH (b[blen - 1]));
struct stat st;
- int err = ((dereference_dest_dir_symlinks ? stat : lstat) (file, &st) == 0
- ? 0 : errno);
+ int stat_result =
+ (dereference_dest_dir_symlinks ? stat (file, &st) : lstat (file, &st));
+ int err = (stat_result == 0 ? 0 : errno);
bool is_a_dir = !err && S_ISDIR (st.st_mode);
if (err && err != ENOENT)
error (EXIT_FAILURE, err, _("accessing %s"), quote (file));
@@ -254,7 +255,7 @@ do_link (const char *source, const char
Try to unlink DEST even if we may have backed it up successfully.
In some unusual cases (when DEST and DEST_BACKUP are hard-links
that refer to the same file), rename succeeds and DEST remains.
- If we didn't remove DEST in that case, the subsequent LINKFUNC
+ If we didn't remove DEST in that case, the subsequent symlink or link
call would fail. */
if (!ok && errno == EEXIST && (remove_existing_files || dest_backup))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- fix for ln.c porting bug on HP Nonstop,
Paul Eggert <=