From dc935a5aa9d4a6551151f1f276ffa2a66b27a40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 11 Jan 2008 13:34:06 +0000 Subject: [PATCH] * warning * save the fd so we can use it :) * open the pty read-write else it won't work... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23393 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/codycam/SftpClient.cpp | 1 - src/apps/codycam/SpawningUploadClient.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/apps/codycam/SftpClient.cpp b/src/apps/codycam/SftpClient.cpp index 6177383afe..a68c884cd2 100644 --- a/src/apps/codycam/SftpClient.cpp +++ b/src/apps/codycam/SftpClient.cpp @@ -62,7 +62,6 @@ bool SftpClient::PrintWorkingDir(string& dir) { bool rc = false; - int len; SendCommand("pwd\n"); BString reply; return rc; diff --git a/src/apps/codycam/SpawningUploadClient.cpp b/src/apps/codycam/SpawningUploadClient.cpp index 9d5accffd4..d63752f3db 100644 --- a/src/apps/codycam/SpawningUploadClient.cpp +++ b/src/apps/codycam/SpawningUploadClient.cpp @@ -45,8 +45,8 @@ SpawningUploadClient::SpawnCommand() //XXX: should use a system-provided TerminalCommand class BString shellcmd = "exec"; const char *args[] = { "/bin/sh", "-c", NULL, NULL }; - int pty = getpty(ptypath, ttypath); - if (pty < 0) + fPty = getpty(ptypath, ttypath); + if (fPty < 0) return B_ERROR; shellcmd << " 0<" << ttypath; @@ -117,7 +117,7 @@ SpawningUploadClient::getpty(char *pty, char *tty) { sprintf(pty, "/dev/pt/%c%c", major[i], minor[j]); sprintf(tty, "/dev/tt/%c%c", major[i], minor[j]); - fd = open(pty, O_RDONLY|O_NOCTTY); + fd = open(pty, O_RDWR|O_NOCTTY); if (fd >= 0) { return fd;