mirror of
https://github.com/tmux/tmux.git
synced 2025-01-08 08:58:47 +00:00
Solaris fixes, mostly from Dagobert Michelsen.
This commit is contained in:
parent
5d3296c53b
commit
514a723f74
@ -204,6 +204,9 @@ endif
|
|||||||
if NO_IMSG
|
if NO_IMSG
|
||||||
nodist_tmux_SOURCES += compat/imsg.c compat/imsg-buffer.c
|
nodist_tmux_SOURCES += compat/imsg.c compat/imsg-buffer.c
|
||||||
endif
|
endif
|
||||||
|
if NO_ERR_H
|
||||||
|
nodist_tmux_SOURCES += compat/err.c
|
||||||
|
endif
|
||||||
if NO_CLOSEFROM
|
if NO_CLOSEFROM
|
||||||
nodist_tmux_SOURCES += compat/closefrom.c
|
nodist_tmux_SOURCES += compat/closefrom.c
|
||||||
endif
|
endif
|
||||||
|
10
compat.h
10
compat.h
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <termios.h>
|
||||||
#include <wchar.h>
|
#include <wchar.h>
|
||||||
|
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
@ -57,6 +58,15 @@ typedef uint32_t u_int32_t;
|
|||||||
typedef uint64_t u_int64_t;
|
typedef uint64_t u_int64_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ERR_H
|
||||||
|
#include <err.h>
|
||||||
|
#else
|
||||||
|
void err(int, const char *, ...);
|
||||||
|
void errx(int, const char *, ...);
|
||||||
|
void warn(const char *, ...);
|
||||||
|
void warnx(const char *, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_PATHS_H
|
#ifndef HAVE_PATHS_H
|
||||||
#define _PATH_BSHELL "/bin/sh"
|
#define _PATH_BSHELL "/bin/sh"
|
||||||
#define _PATH_TMP "/tmp/"
|
#define _PATH_TMP "/tmp/"
|
||||||
|
@ -15,7 +15,10 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
|
||||||
|
97
compat/err.c
Normal file
97
compat/err.c
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
* copyright notice and this permission notice appear in all copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||||
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
err(int eval, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int saved_errno = errno;
|
||||||
|
|
||||||
|
fprintf(stderr, "%s: ", getprogname());
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
if (fmt != NULL) {
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
fprintf(stderr, ": ");
|
||||||
|
}
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
fprintf(stderr, "%s\n", strerror(saved_errno));
|
||||||
|
exit(eval);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
errx(int eval, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
fprintf(stderr, "%s: ", getprogname());
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
if (fmt != NULL) {
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
fprintf(stderr, ": ");
|
||||||
|
}
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
putc('\n', stderr);
|
||||||
|
exit(eval);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
warn(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
int saved_errno = errno;
|
||||||
|
|
||||||
|
fprintf(stderr, "%s: ", getprogname());
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
if (fmt != NULL) {
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
fprintf(stderr, ": ");
|
||||||
|
}
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
fprintf(stderr, "%s\n", strerror(saved_errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
warnx(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
fprintf(stderr, "%s: ", getprogname());
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
if (fmt != NULL) {
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
fprintf(stderr, ": ");
|
||||||
|
}
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
putc('\n', stderr);
|
||||||
|
}
|
@ -21,6 +21,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <stropts.h>
|
#include <stropts.h>
|
||||||
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
10
configure.ac
10
configure.ac
@ -350,6 +350,16 @@ if test "x$found_cmsg_data" = xno; then
|
|||||||
fi
|
fi
|
||||||
AC_SUBST(XOPEN_DEFINES)
|
AC_SUBST(XOPEN_DEFINES)
|
||||||
|
|
||||||
|
# Look for err and friends in err.h.
|
||||||
|
AC_CHECK_FUNC(err, found_err_h=yes, found_err_h=no)
|
||||||
|
AC_CHECK_FUNC(errx, , found_err_h=no)
|
||||||
|
AC_CHECK_FUNC(warn, , found_err_h=no)
|
||||||
|
AC_CHECK_FUNC(warnx, , found_err_h=no)
|
||||||
|
if test "x$found_err_h" = xyes; then
|
||||||
|
AC_CHECK_HEADER(err.h, , found_err_h=no)
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(NO_ERR_H, [test "x$found_err_h" = xno])
|
||||||
|
|
||||||
# Look for imsg in libutil. compat/imsg.c is linked by Makefile.am if missing.
|
# Look for imsg in libutil. compat/imsg.c is linked by Makefile.am if missing.
|
||||||
AC_SEARCH_LIBS(imsg_init, util, found_imsg_init=yes, found_imsg_init=no)
|
AC_SEARCH_LIBS(imsg_init, util, found_imsg_init=yes, found_imsg_init=no)
|
||||||
if test "x$found_imsg_init" = xyes; then
|
if test "x$found_imsg_init" = xyes; then
|
||||||
|
1
tmux.c
1
tmux.c
@ -19,7 +19,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <err.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <event.h>
|
#include <event.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
2
tmux.h
2
tmux.h
@ -55,7 +55,9 @@ struct tmuxpeer;
|
|||||||
struct tmuxproc;
|
struct tmuxproc;
|
||||||
|
|
||||||
/* Default global configuration file. */
|
/* Default global configuration file. */
|
||||||
|
#ifndef TMUX_CONF
|
||||||
#define TMUX_CONF "/etc/tmux.conf"
|
#define TMUX_CONF "/etc/tmux.conf"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Minimum layout cell size, NOT including separator line. The scroll region
|
* Minimum layout cell size, NOT including separator line. The scroll region
|
||||||
|
Loading…
Reference in New Issue
Block a user