X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1bfdc9a38c22af6a9becf133be154a2fa2bc6589..e9241a5304d674cb5455525bce4860408496c9c1:/teshsuite/msg/pid/pid.c diff --git a/teshsuite/msg/pid/pid.c b/teshsuite/msg/pid/pid.c index 0fee70ac43..66c27dc4b5 100644 --- a/teshsuite/msg/pid/pid.c +++ b/teshsuite/msg/pid/pid.c @@ -1,10 +1,10 @@ -/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2015. 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. */ -#include "msg/msg.h" +#include "simgrid/msg.h" #include "xbt/sysdep.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, @@ -13,7 +13,7 @@ const char* mailbox = "mailbox"; #define task_comp_size 1000 #define task_comm_size 100000 -static int onexit(smx_process_exit_status_t status, int *pid){ +static int my_onexit(smx_process_exit_status_t status, int *pid){ XBT_INFO("Process \"%d\" killed.", *pid); return 0; } @@ -21,7 +21,7 @@ static int onexit(smx_process_exit_status_t status, int *pid){ static int sendpid(int argc, char *argv[]) { int pid = MSG_process_self_PID(); - MSG_process_on_exit((int_f_pvoid_pvoid_t)onexit, &pid); + MSG_process_on_exit((int_f_pvoid_pvoid_t)my_onexit, &pid); msg_task_t task = MSG_task_create("pid", task_comp_size, task_comm_size, &pid); XBT_INFO("Sending pid of \"%d\".", pid); MSG_task_send(task, mailbox); @@ -32,7 +32,7 @@ static int sendpid(int argc, char *argv[]) static int killall(int argc, char *argv[]){ msg_task_t task = NULL; - _XBT_GNUC_UNUSED int res; + XBT_ATTRIB_UNUSED int res; int i; for (i=0; i<3;i++) { res = MSG_task_receive(&(task), mailbox); @@ -62,8 +62,5 @@ int main(int argc, char *argv[]) MSG_launch_application(argv[2]); res = MSG_main(); - if (res == MSG_OK) - return 0; - else - return 1; + return res != MSG_OK; }