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
Wed Oct 21 12:04:56 UTC 2020


laforge has submitted this change. ( 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(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



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: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201021/81c5464e/attachment.htm>


More information about the gerrit-log mailing list