summaryrefslogtreecommitdiff
path: root/bin/ln/ln.c
AgeCommit message (Collapse)Author
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2016-05-10Fix operator precedence error; OK guenther@ millert@Tim van der Molen
2015-10-10Pledge that ln only needs "stdio rpath cpath".Doug Hogan
ok deraadt@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-05-23Use errc/warnc to simplify code.Philip Guenther
ok jca@ krw@
2014-05-07Remove the undocumented and ineffective -F option (force hard linkIngo Schwarze
to directory). This doesn't reduce functionality but merely results in a better error message when trying to use the option, and it simplifies the code. The -f option first appeared in AT&T Version 7 UNIX (1979), and Keith Bostic renamed it to -F for 4.3BSD-Reno in 1990 because it conflicted with System V and POSIX. Meanwhile, NetBSD, FreeBSD, and DragonFly removed it, too. From Tristan Le Guern <tleguern at bouledef dot eu>. OK guenther@ krw@
2013-03-12Add support for the -L and -P options.Philip Guenther
Based on a patch from Kent R. Spillner (kspillner (at) acm.org) ok jmc@ millert@
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2008-05-28In -f mode, don't print a warning if source and target already pointTodd C. Miller
to the same inode. This is consistent with other implementations. OK deraadt@ miod@ ray@
2007-09-16"source" and "target" can be either files or directories;Igor Sobrado
cp(1) and ln(1) must have a synopsis consistent with mkdir(1), mv(1), rmdir(1) and others ok jmc@, millert@, otto@
2007-07-31Adapted from DragonflyBSD revisions 1.10 and 1.11: warn when sourceRay Lai
and target are identical. When -f is specified, don't delete source. OK sobrado, feedback from paesco, kettenis, and tedu.
2006-04-25mark usage() __deadTheo de Raadt
2005-12-02Make usage() and manual match. OK jmc, deraadtChad Loder
2005-04-15check snprintf return value and abort if the concatenated path is tooUwe Stuehler
long instead of using the truncated path. also, use the strerror() database instead of repeating the text here. ok krw@, millert@
2004-12-17sync usageJared Yanovich
manpage: - indent examples - document exit status ok jmc
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-04The custom logic used for determining the basename of source fileNils Nordman
was flawed in that it did not account for trailing slashes. Use basename(3) instead. Fixes invocations where target is a directory and source has a trailing slash (e.g. ln -s /tmp/ .). Ok millert@.
2002-07-04ansiTheo de Raadt
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-08-09Actually use the statf function pointer which I missed while hand-patching.Todd C. Miller
Also, don't mention the -h and -n flags for the 2nd usage line since they are no-ops in that case.
2001-08-09Add -h flag to prevent following a symlink to a dir as the dest.Todd C. Miller
Also add -n as an alias for -h for compat with GNU ln. Patch from Phil.Pennock@globnix.org with minor changes by me.
1996-12-14-Wall'ing.Michael Shalayeff
1996-08-02zap getopt() case of -?, come on, it is the default!Theo de Raadt
1996-06-23update rcsidTheo de Raadt
1995-10-18initial import of NetBSD treeTheo de Raadt