[Sshpass-devel] sshpass doesn't work on FreeBSD
Brought to you by:
thesun
|
From: Arsen.Shnurkov <ars...@gm...> - 2012-05-06 16:01:14
|
In several places:
First is definition of SIGWINCH
#ifndef SIGWINCH
#include <sys/signal.h>
#endif
Second is open function:
// in FreeBSD, opening a terminal does not cause it
// to become a process's controlling terminal.
// The flag O_NOCTTY is included only for compatibility;.
|char strControllingTerminalName[L_ctermid];
ctermid(strControllingTerminalName);
if (0 != strcmp(strControllingTerminalName, name))
{
/*
* Slave becomes stdin/stdout/stderr of child.
*/
if (dup2(fds, STDIN_FILENO) != STDIN_FILENO)
{
perror("dup2 error to stdin");
}
if (dup2(fds, STDOUT_FILENO) != STDOUT_FILENO)
{
perror("dup2 error to stdout");
}
if (dup2(fds, STDERR_FILENO) != STDERR_FILENO)
{
perror("dup2 error to stderr");
}
if (fds != STDIN_FILENO &&
fds != STDOUT_FILENO &&
fds != STDERR_FILENO)
{
close(fds);
}
}|
|