aboutsummaryrefslogtreecommitdiff
path: root/jim-aio.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-01-24 10:53:36 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:39 +1000
commit6ef810ae664dccd457fe1ed750f7d509b6f60878 (patch)
tree13f3ab69416d1fc7f5d10db06c1bf83aa0153e4f /jim-aio.c
parenta0017cc44c22a83df8f92600317ad8ccd635e2a1 (diff)
downloadjimtcl-6ef810ae664dccd457fe1ed750f7d509b6f60878.zip
jimtcl-6ef810ae664dccd457fe1ed750f7d509b6f60878.tar.gz
jimtcl-6ef810ae664dccd457fe1ed750f7d509b6f60878.tar.bz2
Bugs, features and tests
source fails with zero length file unknown can't be called recursively *: This can be useful when using unknown to dynamically load code, which may in turn want to dynamically load code *: Limit it to 50 recursions though Allow string greater/less comparison *: Comparing two strings for order did not work Implement file join *: It's not to hard and is handy when working with the current dir, "" Don't omit [unknown] completely from stack trace *: Since we lose valuable informtion, just omit the name Fix return from case Turn regexp patterns into real objects *: Thus caching the compiled regexps Allow error to rethrow an error Replace bcopy() with more standard memcpy() Fixes to parray, improve errorInfo *: errorInfo takes an optional stack trace Add tests for rethrowing errors via errorInfo Fix ndelay *: Was looking at wrong param *: Also fix usage/help for aio.socket Package should be able to call exit *: Currently any return from a package is changed to JIM_ERR Line counting is incorrect for backlash newline
Diffstat (limited to 'jim-aio.c')
-rw-r--r--jim-aio.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/jim-aio.c b/jim-aio.c
index cb8db31..55bf9d5 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -326,7 +326,7 @@ static int aio_cmd_ndelay(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
if (argc) {
long nb;
- if (Jim_GetLong(interp, argv[2], &nb) != JIM_OK) {
+ if (Jim_GetLong(interp, argv[0], &nb) != JIM_OK) {
return JIM_ERR;
}
if (nb) {
@@ -675,7 +675,7 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc,
int on = 1;
if (argc <= 2 ) {
- Jim_WrongNumArgs(interp, 1, argv, "sockspec ?script?");
+ Jim_WrongNumArgs(interp, 1, argv, "type address");
return JIM_ERR;
}
@@ -695,9 +695,7 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc,
srcport = atol(stsrcport);
port = atol(stport);
he = gethostbyname(sthost);
- /* FIX!!!! this still results in null pointer exception here.
- FIXED!!!! debug output but no JIM_ERR done UK.
- */
+
if (!he) {
Jim_SetResultString(interp,hstrerror(h_errno),-1);
return JIM_ERR;
@@ -710,7 +708,7 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc,
break;
case SOCK_STREAM_CL:
sa.sin_family= he->h_addrtype;
- bcopy(he->h_addr,(char *)&sa.sin_addr,he->h_length); /* set address */
+ memcpy((char *)&sa.sin_addr,he->h_addr,he->h_length); /* set address */
sa.sin_port = htons(port);
res = connect(sock,(struct sockaddr*)&sa,sizeof(sa));
if (res) {
@@ -722,7 +720,7 @@ static int JimAioSockCommand(Jim_Interp *interp, int argc,
break;
case SOCK_STREAM_SERV:
sa.sin_family= he->h_addrtype;
- bcopy(he->h_addr,(char *)&sa.sin_addr,he->h_length); /* set address */
+ memcpy((char *)&sa.sin_addr,he->h_addr,he->h_length); /* set address */
sa.sin_port = htons(port);
/* Enable address reuse */