mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 11:18:48 +00:00
Save/restore errno, free pfd buffer.
This commit is contained in:
parent
3859c9f239
commit
f941d270ca
4
server.c
4
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.32 2007-10-24 11:05:59 nicm Exp $ */
|
/* $Id: server.c,v 1.33 2007-10-24 11:21:29 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -174,6 +174,8 @@ server_main(char *srv_path, int srv_fd)
|
|||||||
server_handle_windows(&pfd);
|
server_handle_windows(&pfd);
|
||||||
server_handle_clients(&pfd);
|
server_handle_clients(&pfd);
|
||||||
}
|
}
|
||||||
|
if (pfds != NULL)
|
||||||
|
xfree(pfds);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
for (i = 0; i < ARRAY_LENGTH(&sessions); i++) {
|
||||||
if (ARRAY_ITEM(&sessions, i) != NULL)
|
if (ARRAY_ITEM(&sessions, i) != NULL)
|
||||||
|
6
tmux.c
6
tmux.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.c,v 1.36 2007-10-23 10:48:23 nicm Exp $ */
|
/* $Id: tmux.c,v 1.37 2007-10-24 11:21:29 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -85,6 +85,9 @@ logfile(const char *name)
|
|||||||
void
|
void
|
||||||
sighandler(int sig)
|
sighandler(int sig)
|
||||||
{
|
{
|
||||||
|
int saved_errno;
|
||||||
|
|
||||||
|
saved_errno = errno;
|
||||||
switch (sig) {
|
switch (sig) {
|
||||||
case SIGWINCH:
|
case SIGWINCH:
|
||||||
sigwinch = 1;
|
sigwinch = 1;
|
||||||
@ -96,6 +99,7 @@ sighandler(int sig)
|
|||||||
waitpid(WAIT_ANY, NULL, WNOHANG);
|
waitpid(WAIT_ANY, NULL, WNOHANG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
errno = saved_errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user