Move warn/error into common and make static builds work.

This commit is contained in:
Todd C. Miller
2012-11-25 09:34:40 -05:00
parent c2c6616a0c
commit 2632ec7e69
22 changed files with 202 additions and 266 deletions

View File

@@ -121,8 +121,8 @@ static void check_foreground(void);
/*
* Cleanup hook for error()/errorx()
*/
void
cleanup(int gotsignal)
static void
pty_cleanup(void)
{
debug_decl(cleanup, SUDO_DEBUG_EXEC);
@@ -1294,6 +1294,9 @@ exec_pty(struct command_details *details, int *errfd)
pid_t self = getpid();
debug_decl(exec_pty, SUDO_DEBUG_EXEC);
/* Register cleanup function */
error_callback_register(pty_cleanup);
/* Set command process group here too to avoid a race. */
setpgid(0, self);