Mercurial > hg > toybox
comparison toys/posix/link.c @ 694:786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
The actual code should be the same afterward, this is just cosmetic refactoring.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 13 Nov 2012 17:14:08 -0600 |
parents | 2986aa63a021 |
children |
comparison
equal
deleted
inserted
replaced
693:4a5a250e0633 | 694:786841fdb1e0 |
---|---|
1 /* vi: set sw=4 ts=4: | 1 /* link.c - hardlink a file |
2 * | |
3 * link.c - hardlink a file | |
4 * | 2 * |
5 * Copyright 2011 Rob Landley <rob@landley.net> | 3 * Copyright 2011 Rob Landley <rob@landley.net> |
6 * | 4 * |
7 * See http://opengroup.org/onlinepubs/9699919799/utilities/link.html | 5 * See http://opengroup.org/onlinepubs/9699919799/utilities/link.html |
8 | 6 |
9 USE_LINK(NEWTOY(link, "<2>2", TOYFLAG_USR|TOYFLAG_BIN)) | 7 USE_LINK(NEWTOY(link, "<2>2", TOYFLAG_USR|TOYFLAG_BIN)) |
10 | 8 |
11 config LINK | 9 config LINK |
12 bool "link" | 10 bool "link" |
13 default y | 11 default y |
14 help | 12 help |
15 usage: link FILE NEWLINK | 13 usage: link FILE NEWLINK |
16 | 14 |
17 Create hardlink to a file. | 15 Create hardlink to a file. |
18 */ | 16 */ |
19 | 17 |
20 #include "toys.h" | 18 #include "toys.h" |
21 | 19 |
22 void link_main(void) | 20 void link_main(void) |
23 { | 21 { |
24 if (link(toys.optargs[0], toys.optargs[1])) | 22 if (link(toys.optargs[0], toys.optargs[1])) |
25 perror_exit("couldn't link '%s' to '%s'", toys.optargs[1], | 23 perror_exit("couldn't link '%s' to '%s'", toys.optargs[1], |
26 toys.optargs[0]); | 24 toys.optargs[0]); |
27 } | 25 } |