X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f4b6a29c3d750aa13586342e461793a5747a8267..7ce752524bd815bb66b262e4288903c6a9ebfc93:/examples/lua/masterslave/slave.lua diff --git a/examples/lua/masterslave/slave.lua b/examples/lua/masterslave/slave.lua index f2b8a1274f..e1ade873d4 100644 --- a/examples/lua/masterslave/slave.lua +++ b/examples/lua/masterslave/slave.lua @@ -1,10 +1,16 @@ +-- Copyright (c) 2011-2012, 2014. The SimGrid Team. +-- All rights reserved. + +-- This program is free software; you can redistribute it and/or modify it +-- under the terms of the license (GNU LGPL) which comes with this package. + function Slave(...) - if #arg ~= 1 then + if select("#", ...) ~= 1 then error("Wrong number of arguments (got " .. #arg .. ", expected 1: slave_id)") end - local my_mailbox = "slave " .. arg[1] + local my_mailbox = "slave " .. select(1, ...) simgrid.info("Hello from lua, I'm a poor slave with mailbox: " .. my_mailbox) while true do @@ -21,5 +27,5 @@ function Slave(...) end simgrid.info("I'm done. See you!") -end -- Slave +end -- end_of_slave