[asterisk-commits] mnicholson: testsuite/asterisk/trunk r396 - /asterisk/trunk/asttest/tools/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 10 15:29:44 CDT 2010


Author: mnicholson
Date: Thu Jun 10 15:29:40 2010
New Revision: 396

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=396
Log:
Added a posix.usleep() function

Modified:
    asterisk/trunk/asttest/tools/luaposix.diff

Modified: asterisk/trunk/asttest/tools/luaposix.diff
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/asttest/tools/luaposix.diff?view=diff&rev=396&r1=395&r2=396
==============================================================================
--- asterisk/trunk/asttest/tools/luaposix.diff (original)
+++ asterisk/trunk/asttest/tools/luaposix.diff Thu Jun 10 15:29:40 2010
@@ -1,6 +1,31 @@
+diff -ruN a/lposix.c b/lposix.c
+--- a/lposix.c	2008-07-18 09:30:36.000000000 -0500
++++ b/lposix.c	2010-06-10 15:25:59.000000000 -0500
+@@ -575,6 +575,13 @@
+ 	return 1;
+ }
+ 
++static int Pusleep(lua_State *L)			/** usleep(usec) */
++{
++	useconds_t usec = luaL_checkint(L, 1);
++	lua_pushinteger(L, usleep(usec));
++	return 1;
++}
++
+ 
+ static int Psetenv(lua_State *L)		/** setenv(name,value,[over]) */
+ {
+@@ -1069,6 +1076,7 @@
+ 	{"setenv",		Psetenv},
+ 	{"setpid",		Psetpid},
+ 	{"sleep",		Psleep},
++	{"usleep",		Pusleep},
+ 	{"stat",		Pstat},
+ 	{"sysconf",		Psysconf},
+ 	{"times",		Ptimes},
 diff -ruN a/lposix.h b/lposix.h
 --- a/lposix.h	1969-12-31 18:00:00.000000000 -0600
-+++ b/lposix.h	2009-05-08 15:32:27.000000000 -0500
++++ b/lposix.h	2010-04-23 09:44:46.000000000 -0500
 @@ -0,0 +1,6 @@
 +#ifndef LPOSIX_H
 +#define LPOSIX_H
@@ -10,7 +35,7 @@
 +#endif
 diff -ruN a/Makefile b/Makefile
 --- a/Makefile	2008-07-18 09:31:56.000000000 -0500
-+++ b/Makefile	2009-05-08 15:15:04.000000000 -0500
++++ b/Makefile	2010-04-23 09:44:46.000000000 -0500
 @@ -25,7 +25,7 @@
  
  CPPFLAGS=	-fPIC $(INCS) $(WARN)




More information about the asterisk-commits mailing list