aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-02 18:58:23 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-02 18:58:23 +0000
commitb2b7e9cef1bbe70018505cd4bc222058d7e6f106 (patch)
tree15efbebbe6229d82be8bbfbc7f544a1b5d763a68
parentb1a4ad2b1996936744c679e6ae563986ff701a3a (diff)
downloadluasocket-b2b7e9cef1bbe70018505cd4bc222058d7e6f106.tar.gz
luasocket-b2b7e9cef1bbe70018505cd4bc222058d7e6f106.tar.bz2
luasocket-b2b7e9cef1bbe70018505cd4bc222058d7e6f106.zip
tiny bug in test.
-rw-r--r--src/usocket.c6
-rw-r--r--test/testclnt.lua13
-rw-r--r--test/testsrvr.lua1
3 files changed, 8 insertions, 12 deletions
diff --git a/src/usocket.c b/src/usocket.c
index 0e3d30c..4e73a96 100644
--- a/src/usocket.c
+++ b/src/usocket.c
@@ -17,12 +17,6 @@
17* Initializes module 17* Initializes module
18\*-------------------------------------------------------------------------*/ 18\*-------------------------------------------------------------------------*/
19int sock_open(void) { 19int sock_open(void) {
20#if DOESNT_COMPILE_TRY_THIS
21 struct sigaction ignore;
22 memset(&ignore, 0, sizeof(ignore));
23 ignore.sa_handler = SIG_IGN;
24 sigaction(SIGPIPE, &ignore, NULL);
25#endif
26 /* instals a handler to ignore sigpipe or it will crash us */ 20 /* instals a handler to ignore sigpipe or it will crash us */
27 signal(SIGPIPE, SIG_IGN); 21 signal(SIGPIPE, SIG_IGN);
28 return 1; 22 return 1;
diff --git a/test/testclnt.lua b/test/testclnt.lua
index cdd2c08..ffe487f 100644
--- a/test/testclnt.lua
+++ b/test/testclnt.lua
@@ -447,11 +447,14 @@ function getstats_test()
447 str = data:receive(%d) 447 str = data:receive(%d)
448 data:send(str) 448 data:send(str)
449 ]], c)) 449 ]], c))
450 c:send(string.rep("a", c)) 450 data:send(string.rep("a", c))
451 c:receive(c) 451 data:receive(c)
452 local r, s, a = c:getstats() 452 t = t + c
453 assert(r == t, "received count failed") 453 local r, s, a = data:getstats()
454 assert(s == t, "sent count failed") 454 assert(r == t, "received count failed" .. tostring(r)
455 .. "/" .. tostring(t))
456 assert(s == t, "sent count failed" .. tostring(s)
457 .. "/" .. tostring(t))
455 end 458 end
456 print("ok") 459 print("ok")
457end 460end
diff --git a/test/testsrvr.lua b/test/testsrvr.lua
index 5b842f1..969f95b 100644
--- a/test/testsrvr.lua
+++ b/test/testsrvr.lua
@@ -24,7 +24,6 @@ while 1 do
24 print("server: closing connection...") 24 print("server: closing connection...")
25 break 25 break
26 end 26 end
27 print(command);
28 (loadstring(command))() 27 (loadstring(command))()
29 end 28 end
30end 29end