Merge branch 'obsd-master'

Conflicts:
	cmd.c
	format.c
	osdep-openbsd.c
	tmux.h
This commit is contained in:
Thomas Adam 2012-09-24 17:55:06 +01:00
commit e342304134
3 changed files with 13 additions and 1 deletions

View File

@ -79,6 +79,15 @@ control_write(struct client *c, const char *fmt, ...)
server_push_stdout(c); server_push_stdout(c);
} }
/* Write a buffer, adding a terminal newline. Empties buffer. */
void
control_write_buffer(struct client *c, struct evbuffer *buffer)
{
evbuffer_add_buffer(c->stdout_data, buffer);
evbuffer_add(c->stdout_data, "\n", 1);
server_push_stdout(c);
}
/* Control input callback. Read lines and fire commands. */ /* Control input callback. Read lines and fire commands. */
void void
control_callback(struct client *c, int closed, unused void *data) control_callback(struct client *c, int closed, unused void *data)

View File

@ -137,10 +137,12 @@ error:
char* char*
osdep_get_cwd(pid_t pid) osdep_get_cwd(pid_t pid)
{ {
int name[] = { CTL_KERN, KERN_PROC_CWD, (int)pid }; int name[] = { CTL_KERN, KERN_PROC_CWD, 0 };
static char path[MAXPATHLEN]; static char path[MAXPATHLEN];
size_t pathlen = sizeof path; size_t pathlen = sizeof path;
if ((name[2] = tcgetpgrp(fd)) == -1)
return (NULL);
if (sysctl(name, 3, path, &pathlen, NULL, 0) != 0) if (sysctl(name, 3, path, &pathlen, NULL, 0) != 0)
return (NULL); return (NULL);
return (path); return (path);

1
tmux.h
View File

@ -2217,6 +2217,7 @@ void clear_signals(int);
/* control.c */ /* control.c */
void control_callback(struct client *, int, void*); void control_callback(struct client *, int, void*);
void printflike2 control_write(struct client *, const char *, ...); void printflike2 control_write(struct client *, const char *, ...);
void control_write_buffer(struct client *, struct evbuffer *);
/* control-notify.c */ /* control-notify.c */
void control_notify_window_layout_changed(struct window *); void control_notify_window_layout_changed(struct window *);