From bb18077d49200f1c9ba01437183eafc32be4fb23 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 10 Apr 2003 23:21:58 +0000 Subject: Some style from Andrey Matveev o avoid including sys/types.h and sys/param.h together o sort includes o in one place warn(3) -> warnx(3) o proper usage() (argument `todir' is optional) Also, fromdir was marked as optional in the manual--it is not. --- usr.bin/lndir/lndir.1 | 4 ++-- usr.bin/lndir/lndir.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/usr.bin/lndir/lndir.1 b/usr.bin/lndir/lndir.1 index a53e9c20c68..08d7081e11d 100644 --- a/usr.bin/lndir/lndir.1 +++ b/usr.bin/lndir/lndir.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: lndir.1,v 1.15 2002/02/13 08:33:47 mpech Exp $ +.\" $OpenBSD: lndir.1,v 1.16 2003/04/10 23:21:57 millert Exp $ .\" .\" Copyright (c) 1997, Jason Downs. All rights reserved. .\" @@ -69,7 +69,7 @@ .Op Fl e Ar exceptfile .Op Fl s .Op Fl i -.Op Ar fromdir +.Ar fromdir .Op Ar todir .Sh DESCRIPTION The diff --git a/usr.bin/lndir/lndir.c b/usr.bin/lndir/lndir.c index b5f65b8cc28..27dbc4b1dbd 100644 --- a/usr.bin/lndir/lndir.c +++ b/usr.bin/lndir/lndir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lndir.c,v 1.11 2002/09/23 04:10:14 millert Exp $ */ +/* $OpenBSD: lndir.c,v 1.12 2003/04/10 23:21:57 millert Exp $ */ /* $XConsortium: lndir.c /main/15 1995/08/30 10:56:18 gildea $ */ /* @@ -47,15 +47,15 @@ in this Software without prior written authorization from the X Consortium. % lndir ../X */ -#include -#include -#include -#include #include +#include + +#include #include #include -#include #include +#include +#include #include #include @@ -136,7 +136,7 @@ equivalent(char *lname, char *rname) { char *s; - if (!strcmp(lname, rname)) + if (strcmp(lname, rname) == 0) return(1); for (s = lname; *s && (s = strchr(s, '/')); s++) { while (s[1] == '/') @@ -152,10 +152,10 @@ addexcept(char *name) new = (struct except *)malloc(sizeof(struct except)); if (new == (struct except *)NULL) - err(1, "addexcept"); + err(1, NULL); new->name = strdup(name); if (new->name == (char *)NULL) - err(1, "addexcept"); + err(1, NULL); new->next = exceptions; exceptions = new; @@ -184,7 +184,7 @@ dodir(char *fn, struct stat *fs, struct stat *ts, int rel) DIR *df; if (fs->st_dev == ts->st_dev && fs->st_ino == ts->st_ino) { - warn("%s: From and to directories are identical!", fn); + warnx("%s: From and to directories are identical!", fn); return(1); } @@ -306,7 +306,7 @@ next: void usage(void) { - (void)fprintf(stderr, "usage: %s [-e except] [-si] fromdir todir\n", + (void)fprintf(stderr, "usage: %s [-e except] [-si] fromdir [todir]\n", __progname); exit(1); } -- cgit v1.2.3