bin/79418: [patch] libedit sync from netbsd cvs
Phil Oleson
oz at nixil.net
Tue Apr 5 02:00:23 PDT 2005
Here are patches to port the rest of the userspace apps that use
libevent to use the
H_SETSIZE flag rather than H_EVENT, which will be eliminated with the
upgrade of libevent.
This should allow buildworld to compile clean after the libevent patch
is applied.
Phil.
--
It's a frail sad line between optimism and delusion.
-------------- next part --------------
Index: src/usr.sbin/cdcontrol/cdcontrol.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/cdcontrol/cdcontrol.c,v
retrieving revision 1.48
diff -u -r1.48 cdcontrol.c
--- src/usr.sbin/cdcontrol/cdcontrol.c 1 Apr 2004 16:37:46 -0000 1.48
+++ src/usr.sbin/cdcontrol/cdcontrol.c 5 Apr 2005 08:45:00 -0000
@@ -1130,7 +1130,7 @@
el = el_init("cdcontrol", stdin, stdout,
stderr);
hist = history_init();
- history(hist, &he, H_EVENT, 100);
+ history(hist, &he, H_SETSIZE, 100);
el_set(el, EL_HIST, history, hist);
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_PROMPT, cdcontrol_prompt);
-------------- next part --------------
Index: src/sbin/fsdb/fsdb.c
===================================================================
RCS file: /home/ncvs/src/sbin/fsdb/fsdb.c,v
retrieving revision 1.29
diff -u -r1.29 fsdb.c
--- src/sbin/fsdb/fsdb.c 9 Oct 2004 15:56:34 -0000 1.29
+++ src/sbin/fsdb/fsdb.c 5 Apr 2005 08:41:50 -0000
@@ -223,7 +223,7 @@
printactive(0);
hist = history_init();
- history(hist, &he, H_EVENT, 100); /* 100 elt history buffer */
+ history(hist, &he, H_SETSIZE, 100); /* 100 elt history buffer */
elptr = el_init("fsdb", stdin, stdout, stderr);
el_set(elptr, EL_EDITOR, "emacs");
@@ -243,7 +243,7 @@
* el_parse returns -1 to signal that it's not been handled
* internally.
*/
- if (el_parse(elptr, cmd_argc, cmd_argv) != -1)
+ if (el_parse(elptr, cmd_argc, (const char **)cmd_argv) != -1)
continue;
if (cmd_argc) {
known = 0;
-------------- next part --------------
Index: src/usr.sbin/lpr/lpc/lpc.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/lpr/lpc/lpc.c,v
retrieving revision 1.30
diff -u -r1.30 lpc.c
--- src/usr.sbin/lpr/lpc/lpc.c 22 Feb 2005 02:56:42 -0000 1.30
+++ src/usr.sbin/lpr/lpc/lpc.c 5 Apr 2005 08:43:31 -0000
@@ -167,7 +167,7 @@
if (!el) {
el = el_init("lpc", stdin, stdout, stderr);
hist = history_init();
- history(hist, &he, H_EVENT, 100);
+ history(hist, &he, H_SETSIZE, 100);
el_set(el, EL_HIST, history, hist);
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_PROMPT, lpc_prompt);
-------------- next part --------------
Index: src/bin/sh/histedit.c
===================================================================
RCS file: /home/ncvs/src/bin/sh/histedit.c,v
retrieving revision 1.26
diff -u -r1.26 histedit.c
--- src/bin/sh/histedit.c 6 Apr 2004 20:06:51 -0000 1.26
+++ src/bin/sh/histedit.c 5 Apr 2005 08:40:14 -0000
@@ -156,7 +156,7 @@
if (hs == NULL || *hs == '\0' ||
(histsize = atoi(hs)) < 0)
histsize = 100;
- history(hist, &he, H_EVENT, histsize);
+ history(hist, &he, H_SETSIZE, histsize);
}
}
@@ -318,7 +318,7 @@
if (editor) {
int fd;
INTOFF; /* easier */
- sprintf(editfile, "%s/_shXXXXXX", _PATH_TMP);
+ snprintf(editfile, sizeof(editfile), "%s_shXXXXXX", _PATH_TMP);
if ((fd = mkstemp(editfile)) < 0)
error("can't create temporary file %s", editfile);
if ((efp = fdopen(fd, "w")) == NULL) {
-------------- next part --------------
Index: src/usr.bin/tftp/main.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/tftp/main.c,v
retrieving revision 1.21
diff -u -r1.21 main.c
--- src/usr.bin/tftp/main.c 12 Oct 2003 00:27:55 -0000 1.21
+++ src/usr.bin/tftp/main.c 5 Apr 2005 08:42:56 -0000
@@ -635,7 +635,7 @@
if (vrbose) {
el = el_init("tftp", stdin, stdout, stderr);
hist = history_init();
- history(hist, &he, H_EVENT, 100);
+ history(hist, &he, H_SETSIZE, 100);
el_set(el, EL_HIST, history, hist);
el_set(el, EL_EDITOR, "emacs");
el_set(el, EL_PROMPT, command_prompt);
More information about the freebsd-bugs
mailing list