Change in osmocom-bb[master]: mobile: Use osmo_fd_setup() in script_lua.c

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Oct 19 10:20:30 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/20769 )


Change subject: mobile: Use osmo_fd_setup() in script_lua.c
......................................................................

mobile: Use osmo_fd_setup() in script_lua.c

Change-Id: Ib6f97b9b8f3af63b81b92071b7fdb1fd55da89a5
---
M src/host/layer23/src/mobile/script_lua.c
1 file changed, 3 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/69/20769/1

diff --git a/src/host/layer23/src/mobile/script_lua.c b/src/host/layer23/src/mobile/script_lua.c
index 269c9df..50315bd 100644
--- a/src/host/layer23/src/mobile/script_lua.c
+++ b/src/host/layer23/src/mobile/script_lua.c
@@ -497,6 +497,7 @@
 static int lua_register_fd(lua_State *L)
 {
 	struct fd_userdata *fdu;
+	int fd;
 
 	/* fd, cb */
 	luaL_argcheck(L, lua_isnumber(L, -2), 1, "needs to be a filedescriptor");
@@ -510,10 +511,8 @@
 	lua_setmetatable(L, -2);
 
 	/* Set the filedescriptor */
-	fdu->fd.fd = (int) lua_tonumber(L, -3);
-	fdu->fd.cb = lua_fd_cb;
-	fdu->fd.when = OSMO_FD_READ;
-	fdu->fd.data = fdu;
+	fd = (int) lua_tonumber(L, -3);
+	osmo_fd_setup(&fdu->fd, fd, OSMO_FD_READ, lua_fd_cb, fdu, 0);
 
 	/* Assuming that an error here will lead to a GC */
 	if (osmo_fd_register(&fdu->fd) != 0) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/20769
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ib6f97b9b8f3af63b81b92071b7fdb1fd55da89a5
Gerrit-Change-Number: 20769
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201019/250c7203/attachment.htm>


More information about the gerrit-log mailing list