summaryrefslogtreecommitdiff
authorzecke <zecke>2002-10-12 01:05:54 (UTC)
committer zecke <zecke>2002-10-12 01:05:54 (UTC)
commita92703ad1ed767713de21c2389b06434dc223eba (patch) (side-by-side diff)
treeef5368486c2c4472e41c78ec5c7e3c1821e4c88d
parent78eddaa8057462b0b8e94f10f8673bb9f555061b (diff)
downloadopie-a92703ad1ed767713de21c2389b06434dc223eba.zip
opie-a92703ad1ed767713de21c2389b06434dc223eba.tar.gz
opie-a92703ad1ed767713de21c2389b06434dc223eba.tar.bz2
missing commits
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/filetransfer.h7
-rw-r--r--noncore/apps/opie-console/procctl.cpp1
-rw-r--r--noncore/apps/opie-console/procctl.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/filetransfer.h b/noncore/apps/opie-console/filetransfer.h
index 0829f16..9cc1e8d 100644
--- a/noncore/apps/opie-console/filetransfer.h
+++ b/noncore/apps/opie-console/filetransfer.h
@@ -10,44 +10,45 @@
class QSocketNotifier;
class OProcess;
class FileTransferControl;
class FileTransfer : public FileTransferLayer{
Q_OBJECT
friend class FileTransferControl;
public:
enum Type {
SZ = 0,
SX,
SY
};
FileTransfer( Type t, IOLayer* );
~FileTransfer();
void sendFile( const QString& file );
void sendFile( const QFile& );
void cancel();
private slots:
void setupChild();
void slotRead();
void slotProgress( const QStringList& );
+ void slotExec();
private:
/*
* FIXME? What does happen if we've
* two FileTransfers at a time?
* Have a procctl which does listen
* for termination and then send a signal
*/
- static pid_t m_pid;
+ pid_t m_pid;
int m_fd;
int m_prog;
int m_info[2];
int m_comm[2];
+ int m_term[2];
QString m_file;
Type m_type;
QSocketNotifier *m_not;
- static void signal_handler(int);
- static bool terminate;
+ QSocketNotifier* m_proc;
};
#endif
diff --git a/noncore/apps/opie-console/procctl.cpp b/noncore/apps/opie-console/procctl.cpp
index ff6bea8..b0b6846 100644
--- a/noncore/apps/opie-console/procctl.cpp
+++ b/noncore/apps/opie-console/procctl.cpp
@@ -50,47 +50,48 @@ void ProcCtl::remove( pid_t pi ) {
if ( pi == con->pid ) {
forw->prev = con->prev;
delete con;
return;
}
forw = con;
con = con->prev;
}
}
void ProcCtl::remove( ProcContainer con ) {
remove( con.pid );
}
int ProcCtl::status(pid_t pid )const{
ProcContainer *con = m_last;
while (con) {
if (con->pid == pid )
return con->status;
con = con->prev;
}
return -1;
}
void ProcCtl::signal_handler(int) {
+ qWarning("signal handler");
int status;
signal( SIGCHLD, signal_handler );
pid_t pi = waitpid( -1, &status, WNOHANG );
/*
* find the container for pid
*
*/
if ( pi < 0 ) {
return;
}
ProcContainer* con = m_last;
while (con) {
if ( con->pid == pi ) {
con->status = status;
char result = 1;
/* give a 'signal' */
::write(con->fd, &result, 1 );
}
con = con->prev;
}
}
diff --git a/noncore/apps/opie-console/procctl.h b/noncore/apps/opie-console/procctl.h
index 5e96423..1da7c6d 100644
--- a/noncore/apps/opie-console/procctl.h
+++ b/noncore/apps/opie-console/procctl.h
@@ -1,36 +1,37 @@
#ifndef OPIE_PROC_CTL_H
#define OPIE_PROC_CTL_H
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <qmap.h>
struct ProcContainer {
pid_t pid;
int fd;
int status;
ProcContainer* prev;
};
class ProcCtl {
private:
ProcCtl();
public:
~ProcCtl();
- ProcCtl* self();
+ static ProcCtl* self();
int status(pid_t)const;
void add( pid_t, int fd );
void remove( pid_t );
void remove( ProcContainer );
private:
static void signal_handler(int);
static ProcContainer* m_last;
static ProcCtl* m_self;
+
};
#endif