SCCS-vsn: sbin/restore/utilities.c 3.10
/* Copyright (c) 1983 Regents of the University of California */
#ifndef lint
/* Copyright (c) 1983 Regents of the University of California */
#ifndef lint
-static char sccsid[] = "@(#)utilities.c 3.9 (Berkeley) 83/04/11";
+static char sccsid[] = "@(#)utilities.c 3.10 (Berkeley) 83/04/16";
#endif
#include "restore.h"
#endif
#include "restore.h"
char *from, *to;
{
if (rename(from, to) < 0) {
char *from, *to;
{
if (rename(from, to) < 0) {
- perror("renameit");
- panic("Cannot rename %s to %s\n", from, to);
+ fprintf(stderr, "Warning: cannot rename %s to %s\n", from, to);
+ perror("rename");
+ return;
}
vprintf(stdout, "rename %s to %s\n", from, to);
}
}
vprintf(stdout, "rename %s to %s\n", from, to);
}
badentry(ep, "removenode: not a node");
if (ep->e_entries != NIL)
badentry(ep, "removenode: non-empty directory");
badentry(ep, "removenode: not a node");
if (ep->e_entries != NIL)
badentry(ep, "removenode: non-empty directory");
+ ep->e_flags |= REMOVED;
+ ep->e_flags &= ~TMPNAME;
cp = myname(ep);
if (rmdir(cp) < 0) {
cp = myname(ep);
if (rmdir(cp) < 0) {
- perror("removenode");
- panic("Cannot remove node %s\n", cp);
+ fprintf(stderr, "Warning: ");
+ fflush(stderr);
+ perror(cp);
+ return;
- ep->e_flags |= REMOVED;
- ep->e_flags &= ~TMPNAME;
vprintf(stdout, "Remove node %s\n", cp);
}
vprintf(stdout, "Remove node %s\n", cp);
}
if (ep->e_type != LEAF)
badentry(ep, "removeleaf: not a leaf");
if (ep->e_type != LEAF)
badentry(ep, "removeleaf: not a leaf");
+ ep->e_flags |= REMOVED;
+ ep->e_flags &= ~TMPNAME;
cp = myname(ep);
if (unlink(cp) < 0) {
cp = myname(ep);
if (unlink(cp) < 0) {
- perror("removeleaf");
- panic("Cannot remove leaf %s\n", cp);
+ fprintf(stderr, "Warning: ");
+ fflush(stderr);
+ perror(cp);
+ return;
- ep->e_flags |= REMOVED;
- ep->e_flags &= ~TMPNAME;
vprintf(stdout, "Remove leaf %s\n", cp);
}
vprintf(stdout, "Remove leaf %s\n", cp);
}
if (type == SYMLINK) {
if (symlink(existing, new) < 0) {
if (type == SYMLINK) {
if (symlink(existing, new) < 0) {
- perror("linkit");
- panic("Cannot create symbolic link %s->%s\n",
+ fprintf(stderr,
+ "Warning: cannot create symbolic link %s->%s\n",
+ perror("symlink");
+ return;
}
} else if (type == HARDLINK) {
if (link(existing, new) < 0) {
}
} else if (type == HARDLINK) {
if (link(existing, new) < 0) {
- perror("linkit");
- panic("Cannot create hard link %s->%s\n",
+ fprintf(stderr,
+ "Warning: cannot create hard link %s->%s\n",
+ perror("link");
+ return;
}
} else {
panic("linkit: unknown type %d\n", type);
}
} else {
panic("linkit: unknown type %d\n", type);