diff options
author | Steve Bennett <steveb@workware.net.au> | 2010-01-24 12:11:20 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2010-10-15 11:02:44 +1000 |
commit | 9652302fec62f76bf894c6b9eb849bda6994c293 (patch) | |
tree | ca40df6d8ea59c853066b7c5361238d8fdc6be49 /jim-aio.c | |
parent | a7335808c5725934d81dbe68247b62a6ab08bf2f (diff) | |
download | jimtcl-9652302fec62f76bf894c6b9eb849bda6994c293.zip jimtcl-9652302fec62f76bf894c6b9eb849bda6994c293.tar.gz jimtcl-9652302fec62f76bf894c6b9eb849bda6994c293.tar.bz2 |
Various general fixes and cleanups
Add lsearch -command, update case to use lsearch
Rename tcl6.tcl to tclcompat.tcl
Remove // style comments
Expand some tabs to spaces
Fix some compiler warnings
Remove some unused functions
Don't close fd=-1 in exec
Diffstat (limited to 'jim-aio.c')
-rw-r--r-- | jim-aio.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -60,14 +60,13 @@ #define AIO_BUF_LEN 1024 #define AIO_KEEPOPEN 1 -#define AIO_FDOPEN 2 typedef struct AioFile { FILE *fp; Jim_Obj *filename; int type; - int OpenFlags; /* AIO_KEEPOPEN? keep FILE*, AIO_FDOPEN? FILE* created via fdopen */ + int OpenFlags; /* AIO_KEEPOPEN? keep FILE* */ int fd; int flags; Jim_Obj *rEvent; @@ -101,9 +100,6 @@ static void JimAioDelProc(Jim_Interp *interp, void *privData) if (!(af->OpenFlags & AIO_KEEPOPEN)) { fclose(af->fp); } - if (!af->OpenFlags == AIO_FDOPEN) { - close(af->fd); - } #ifdef with_jim_ext_eventloop /* remove existing EventHandlers */ if (af->rEvent) { @@ -376,7 +372,7 @@ static int aio_cmd_accept(Jim_Interp *interp, int argc, Jim_Obj *const *argv) af->filename = Jim_NewStringObj(interp, "accept", -1); Jim_IncrRefCount(af->filename); af->fp = fdopen(sock,"r+"); - af->OpenFlags = AIO_FDOPEN; + af->OpenFlags = 0; af->flags = fcntl(af->fd,F_GETFL); af->rEvent = NULL; af->wEvent = NULL; @@ -706,7 +702,7 @@ static int JimMakeChannel(Jim_Interp *interp, Jim_Obj *filename, const char *hdl af = Jim_Alloc(sizeof(*af)); af->fp = fp; af->fd = fd; - af->OpenFlags = AIO_FDOPEN; + af->OpenFlags = 0; af->filename = filename; Jim_IncrRefCount(af->filename); af->flags = fcntl(af->fd, F_GETFL); |