From 337c0de59186a44f7a146bc28628ee10f6e5f9ed Mon Sep 17 00:00:00 2001 From: mquinson Date: Wed, 12 Apr 2006 09:10:10 +0000 Subject: [PATCH] Use long int for the pids, just to be sure without doublechecking what the size of pid_t is on this arch git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2140 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/gras/virtu.h | 2 +- src/gras/Virtu/rl_process.c | 4 ++-- src/gras/Virtu/sg_process.c | 6 +++--- src/xbt/log_default_appender.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/gras/virtu.h b/include/gras/virtu.h index 1e0464c4e8..65d3a81a22 100644 --- a/include/gras/virtu.h +++ b/include/gras/virtu.h @@ -46,7 +46,7 @@ gras_os_myname(void); * Returns the process ID of the current process. (This is often used by routines that generate unique temporary file names.) */ -int gras_os_getpid(void); +long int gras_os_getpid(void); /** @} */ SG_END_DECL() diff --git a/src/gras/Virtu/rl_process.c b/src/gras/Virtu/rl_process.c index 49f6e9032c..64c5f12f15 100644 --- a/src/gras/Virtu/rl_process.c +++ b/src/gras/Virtu/rl_process.c @@ -29,8 +29,8 @@ const char *xbt_procname(void) { else return ""; } -int gras_os_getpid(void) { - return getpid(); +long int gras_os_getpid(void) { + return (long int) getpid(); } /* ************************************************************************** diff --git a/src/gras/Virtu/sg_process.c b/src/gras/Virtu/sg_process.c index 0883454d15..2ad07e2a17 100644 --- a/src/gras/Virtu/sg_process.c +++ b/src/gras/Virtu/sg_process.c @@ -144,10 +144,10 @@ const char* xbt_procname(void) { return ""; } -int gras_os_getpid(void) { +long int gras_os_getpid(void) { m_process_t process = MSG_process_self(); if ((process != NULL) && (process->simdata)) - return MSG_process_get_PID(MSG_process_self()); + return (long int)MSG_process_get_PID(MSG_process_self()); else - return 0; + return (long int)0; } diff --git a/src/xbt/log_default_appender.c b/src/xbt/log_default_appender.c index df94569ce4..0126353bc0 100644 --- a/src/xbt/log_default_appender.c +++ b/src/xbt/log_default_appender.c @@ -41,7 +41,7 @@ static const char* xbt_logappender_verbose_information(void) { begin_of_time=gras_os_time(); if(strlen(xbt_procname())) - sprintf(buffer,"%s:%s:(%d) %f", gras_os_myname(), + sprintf(buffer,"%s:%s:(%ld) %f", gras_os_myname(), xbt_procname(),gras_os_getpid(),gras_os_time()-begin_of_time); else buffer[0]=0; -- 2.20.1