X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/49f488eb5e757db401a81bc40a30a84d1abcaf88..55584999e396fae97c47a9d83d35d6b45c7bed97:/practicas/pipi/src/test_ipin.cpp?ds=inline diff --git a/practicas/pipi/src/test_ipin.cpp b/practicas/pipi/src/test_ipin.cpp index 1d21ab6..10010e9 100644 --- a/practicas/pipi/src/test_ipin.cpp +++ b/practicas/pipi/src/test_ipin.cpp @@ -32,11 +32,13 @@ int main(int argc, char* argv[]) proto = atoi(argv[5]); if (argc > 6) queue_id = atoi(argv[6]); + int que_id = msgget(queue_id, IPC_CREAT | 0666); + assert(que_id != -1); Dev dev(addr, mtu, queue_id); - int que_id = msgget(queue_id+1, IPC_CREAT | 0666); + que_id = msgget(queue_id+1, IPC_CREAT | 0666); assert(que_id != -1); Dev fwque(addr, DEV_MAX_MTU, queue_id+1); - IPIn ipin(addr, dev, fwque, router, forward); + IPIn ipin(addr, dev, fwque, router, forward, std::cerr); struct msqid_ds minfo; for (msgctl(dev.que_id, IPC_STAT, &minfo); minfo.msg_qnum; msgctl(dev.que_id, IPC_STAT, &minfo))