[5515] in Athena Bugs

home help back first fref pref prev next nref lref last post

patch

daemon@ATHENA.MIT.EDU (John Carr)
Wed Jul 11 23:00:22 1990

To: bugs@ATHENA.MIT.EDU
Date: Wed, 11 Jul 90 23:00:06 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>


This appears to fix the bug described in changes.71 #1038.  The problem was
that the sequence link, unlink was being used to rename a file.  Since
link() follows symbolic links, this fails if the object being moved is a
symlink to another filesystem.

*** /source/athena/new/patch/util.c	Sat May 20 14:17:41 1989
--- util.c	Wed Jul 11 22:56:36 1990
***************
*** 61,67 ****
  	if (debug & 4)
  	    say3("Moving %s to %s.\n", to, bakname);
  #endif
! 	if (link(to, bakname) < 0) {
  	    say3("patch: can't backup %s, output is in %s\n",
  		to, from);
  	    return -1;
--- 61,67 ----
  	if (debug & 4)
  	    say3("Moving %s to %s.\n", to, bakname);
  #endif
! 	if (link(to, bakname) < 0 && rename(to,bakname)) {
  	    say3("patch: can't backup %s, output is in %s\n",
  		to, from);
  	    return -1;

home help back first fref pref prev next nref lref last post