Home | History | Annotate | Download | only in posix

Lines Matching defs:new

29   char *dest = toys.optargs[--toys.optc], *new;
51 if (S_ISDIR(buf.st_mode)) new = xmprintf("%s/%s", dest, basename(try));
52 else new = dest;
57 oldnew = new;
59 new = xmprintf("%s_XXXXXX", new);
60 rc = mkstemp(new);
63 if (unlink(new)) perror_msg("unlink '%s'", new);
67 rc = (toys.optflags & FLAG_s) ? symlink(try, new) : link(try, new);
72 rc = rename(new, oldnew);
74 if (rc && unlink(new)) perror_msg("unlink '%s'", new);
77 free(new);
78 new = oldnew;
82 (toys.optflags & FLAG_s) ? "symbolic" : "hard", try, new);
84 if (toys.optflags & FLAG_v) fprintf(stderr, "'%s' -> '%s'\n", new, try);
86 if (new != dest) free(new);