- /* Get rid of new link */
- (void) cat_delete(hfsmp, &cp->c_desc, &cp->c_attr);
-
- /* Put the source file back */
- // XXXdbg
- #if 1
- {
- int err;
- err = cat_rename(hfsmp, &to_desc, &dcp->c_desc, &cp->c_desc, NULL);
- if (err)
- panic("hfs_makelink: error %d from cat_rename backout 2", err);
- }
- #else
- (void) cat_rename(hfsmp, &to_desc, &dcp->c_desc, &cp->c_desc, NULL);
- #endif
- goto out;
+ int err;
+
+ /* Get rid of new link */
+ (void) cat_delete(hfsmp, &cp->c_desc, &cp->c_attr);
+
+ // Put this back to what it was before.
+ cp->c_desc.cd_cnid = orig_cnid;
+
+ /* Put the source file back */
+ err = cat_rename(hfsmp, &to_desc, &dcp->c_desc, &cp->c_desc, NULL);
+ if (err)
+ panic("hfs_makelink: error %d from cat_rename backout 2", err);
+
+ goto out;