marignotti/mdetach.c

31 lines
642 B
C
Raw Permalink Normal View History

2012-05-05 05:08:27 +00:00
#include "marignotti.h"
#include <gno/kerntool.h>
#include <errno.h>
2012-05-05 06:20:05 +00:00
#include <misctool.h>
2012-05-05 05:08:27 +00:00
#pragma noroot
#pragma optimize 79
//
int mdetach(Entry *e, void *p1, void *p2, void *p3, void *p4, void *p5)
{
// TODO -- SO_LINGER/SO_LINGER_SEC
2012-05-05 06:20:05 +00:00
LongWord timeout;
2012-05-05 05:08:27 +00:00
timeout = 0; // GetTick() + 120 * 60;
IncBusy();
TCPIPCloseTCP(e->ipid);
// hmmm this is in the close() call, so the
// fd won't be valid afterwards....
e->select_rd_pid = 0xffff;
e->select_wr_pid = 0xffff;
2012-05-05 05:08:27 +00:00
e->command = kCommandDisconnectAndLogout;
e->cookie = 0;
2012-05-05 06:20:05 +00:00
e->timeout = timeout;
DecBusy();
2012-05-05 05:08:27 +00:00
return 0;
2016-01-06 00:59:13 +00:00
}