From: Simon Schubert Date: Sun, 22 Jul 2007 22:46:09 +0000 (+0000) Subject: Make vinum use libedit instead of libreadline. X-Git-Tag: v2.0.1~2554 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/744edb305f5e4a7282e93fc6521daf5977e01e5a Make vinum use libedit instead of libreadline. Submitted-by: pavalos@ --- diff --git a/sbin/vinum/Makefile b/sbin/vinum/Makefile index d7a741f181..7a32719bb6 100644 --- a/sbin/vinum/Makefile +++ b/sbin/vinum/Makefile @@ -1,13 +1,13 @@ # $FreeBSD: src/sbin/vinum/Makefile,v 1.12.2.2 2001/08/01 09:13:24 obrien Exp $ -# $DragonFly: src/sbin/vinum/Makefile,v 1.8 2006/10/17 00:55:44 pavalos Exp $ +# $DragonFly: src/sbin/vinum/Makefile,v 1.9 2007/07/22 22:46:09 corecode Exp $ PROG= vinum SRCS= v.c list.c vinumparser.c vinumutil.c vext.h commands.c MAN= vinum.8 WARNS?= 2 -CFLAGS+= -I${.CURDIR}/../../sys -DPADD= ${LIBUTIL} ${LIBREADLINE} ${LIBTERMCAP} -LDADD= -lreadline -ltermcap -ldevstat +CFLAGS+= -I${.CURDIR}/../../lib/libedit -I${.CURDIR}/../../sys +DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} +LDADD= -ledit -ltermcap -ldevstat .include diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c index d1594fc21f..b15430bdb3 100644 --- a/sbin/vinum/commands.c +++ b/sbin/vinum/commands.c @@ -34,7 +34,7 @@ * * $Id: commands.c,v 1.14 2000/11/14 20:01:23 grog Exp grog $ * $FreeBSD: src/sbin/vinum/commands.c,v 1.31.2.6 2003/06/06 05:13:29 grog Exp $ - * $DragonFly: src/sbin/vinum/commands.c,v 1.7 2007/01/20 19:20:39 dillon Exp $ + * $DragonFly: src/sbin/vinum/commands.c,v 1.8 2007/07/22 22:46:09 corecode Exp $ */ #define _KERNEL_STRUCTURES @@ -59,7 +59,6 @@ #include #include #include -#include #include #include diff --git a/sbin/vinum/v.c b/sbin/vinum/v.c index 19e0cca0ed..8a1ca4cf07 100644 --- a/sbin/vinum/v.c +++ b/sbin/vinum/v.c @@ -34,7 +34,7 @@ * * $Id: v.c,v 1.31 2000/09/03 01:29:26 grog Exp grog $ * $FreeBSD: src/sbin/vinum/v.c,v 1.26.2.3 2001/03/13 03:04:06 grog Exp $ - * $DragonFly: src/sbin/vinum/v.c,v 1.5 2007/01/20 19:20:39 dillon Exp $ + * $DragonFly: src/sbin/vinum/v.c,v 1.6 2007/07/22 22:46:09 corecode Exp $ */ #include @@ -54,14 +54,13 @@ #include "vext.h" #include #include -#include #include #include #include #include FILE *cf; /* config file handle */ -FILE *history; /* history file */ +FILE *hist; /* history file */ char *historyfile; /* and its name */ char *dateformat; /* format in which to store date */ @@ -139,11 +138,11 @@ main(int argc, char *argv[], char *envp[]) errno); exit(1); } - history = fopen(historyfile, "a+"); - if (history != NULL) { + hist = fopen(historyfile, "a+"); + if (hist != NULL) { timestamp(); - fprintf(history, "*** " VINUMMOD " started ***\n"); - fflush(history); /* before we start the daemon */ + fprintf(hist, "*** " VINUMMOD " started ***\n"); + fflush(hist); /* before we start the daemon */ } superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* open vinum superdevice */ if (superdev < 0) { /* no go */ @@ -224,8 +223,8 @@ main(int argc, char *argv[], char *envp[]) if (tokens) parseline(tokens, token); /* and do what he says */ } - if (history) - fflush(history); + if (hist) + fflush(hist); } } return 0; /* normal completion */ @@ -316,11 +315,11 @@ parseline(int args, char *argv[]) int j; enum keyword command; /* command to execute */ - if (history != NULL) { /* save the command to history file */ + if (hist != NULL) { /* save the command to history file */ timestamp(); for (i = 0; i < args; i++) /* all args */ - fprintf(history, "%s ", argv[i]); - fputs("\n", history); + fprintf(hist, "%s ", argv[i]); + fputs("\n", hist); } if ((args == 0) /* empty line */ ||(*argv[0] == '#')) /* or a comment, */ @@ -525,9 +524,9 @@ make_devices(void) perror(VINUMMOD ": Can't write to /dev"); return; } - if (history) { + if (hist) { timestamp(); - fprintf(history, "*** Created devices ***\n"); + fprintf(hist, "*** Created devices ***\n"); } if (superdev >= 0) /* super device open */ close(superdev); @@ -849,7 +848,7 @@ timestamp(void) char datetext[MAXDATETEXT]; time_t sec; - if (history != NULL) { + if (hist != NULL) { if (gettimeofday(&now, NULL) != 0) { fprintf(stderr, "Can't get time: %s\n", strerror(errno)); return; @@ -857,7 +856,7 @@ timestamp(void) sec = now.tv_sec; date = localtime(&sec); strftime(datetext, MAXDATETEXT, dateformat, date), - fprintf(history, + fprintf(hist, "%s.%06ld ", datetext, now.tv_usec);