Merge pull request #478 from sureshsundriyal/openbsd

Fix lnav builds on OpenBSD
pull/482/head
Tim Stack 7 years ago committed by GitHub
commit 336b3d9945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,8 +29,6 @@
#include "config.h"
#include <wordexp.h>
#include <vector>
#include "json_ptr.hh"

@ -159,7 +159,7 @@ void grep_proc::child_loop(void)
char outbuf[BUFSIZ * 2];
string line_value;
stdout = fdopen(STDOUT_FILENO, "w");
*stdout = *(fdopen(STDOUT_FILENO, "w"));
/* Make sure buffering is on, not sure of the state in the parent. */
if (setvbuf(stdout, outbuf, _IOFBF, BUFSIZ * 2) < 0) {
perror("setvbuf");

@ -59,6 +59,10 @@
#include <readline/readline.h>
#if defined(__OpenBSD__) && defined(__clang__) && \
!defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
#define _WCHAR_H_CPLUSPLUS_98_CONFORMANCE_
#endif
#include <map>
#include <set>
#include <stack>
@ -2086,7 +2090,7 @@ static void looper(void)
sql_context
.set_highlighter(readline_sqlite_highlighter)
.set_quote_chars("\"")
.with_readline_var(&rl_completer_word_break_characters,
.with_readline_var((char **)&rl_completer_word_break_characters,
" \t\n(),");
exec_context.set_highlighter(readline_shlex_highlighter);

@ -36,7 +36,6 @@
#include <stdio.h>
#include <fcntl.h>
#include <ctype.h>
#include <wordexp.h>
#include <fstream>
@ -700,36 +699,6 @@ bool read_file(const char *filename, string &out)
return false;
}
bool wordexperr(int rc, string &msg)
{
switch (rc) {
case WRDE_BADCHAR:
msg = "error: invalid filename character";
return false;
case WRDE_CMDSUB:
msg = "error: command substitution is not allowed";
return false;
case WRDE_BADVAL:
msg = "error: unknown environment variable in file name";
return false;
case WRDE_NOSPACE:
msg = "error: out of memory";
return false;
case WRDE_SYNTAX:
msg = "error: invalid syntax";
return false;
default:
break;
}
return true;
}
size_t abbreviate_str(char *str, size_t len, size_t max_len)
{
size_t last_start = 1;

@ -436,8 +436,6 @@ inline bool pollfd_ready(const std::vector<struct pollfd> &pollfds, int fd, shor
return false;
};
bool wordexperr(int rc, std::string &msg);
inline void rusagesub(const struct rusage &left, const struct rusage &right, struct rusage &diff_out)
{
timersub(&left.ru_utime, &right.ru_utime, &diff_out.ru_utime);

@ -29,8 +29,6 @@
#include "config.h"
#include <wordexp.h>
#include "lnav.hh"
#include "lnav_util.hh"
#include "sysclip.hh"

Loading…
Cancel
Save