char* osrfChatMkAuthKey() {
char keybuf[112];
bzero(keybuf, 112);
- snprintf(keybuf, 111, "%d%d%s", (int) time(NULL), getpid(), getenv("HOSTNAME"));
+ snprintf(keybuf, 111, "%d%ld%s", (int) time(NULL), (long) getpid(), getenv("HOSTNAME"));
return strdup(shahash(keybuf));
}
char id[256];
memset(id,0,256);
- sprintf(id, "%f.%d%d", get_timestamp_millis(), (int)time(NULL), getpid());
+ sprintf(id, "%f.%d%ld", get_timestamp_millis(), (int)time(NULL), (long) getpid());
session->session_id = strdup(id);
osrfLogDebug( OSRF_LOG_MARK, "Building a new client session with id [%s] [%s]",
session->remote_service, session->session_id );
buffer_free(gbuf);
- osrfLogDebug( OSRF_LOG_MARK, "Child with max-requests=%d, num-served=%d exiting...[%d]",
- child->max_requests, i, getpid() );
+ osrfLogDebug( OSRF_LOG_MARK, "Child with max-requests=%d, num-served=%d exiting...[%ld]",
+ child->max_requests, i, (long) getpid() );
osrf_prefork_child_exit(child); /* just to be sure */
}
if( (pid=fork()) ) { /* parent */
signal(SIGINT, sig_int);
- fprintf(stderr, "Listener: %d\n", getpid() );
+ fprintf(stderr, "Listener: %ld\n", (long) getpid() );
char buf[300];
memset(buf, 0, 300);
printf("=> ");
} else {
- fprintf(stderr, "Sender: %d\n", getpid() );
+ fprintf(stderr, "Sender: %ld\n", (long) getpid() );
transport_message* recv;
while( (recv=client_recv( client, -1)) ) {
/* go ahead and create the xid prefix so it will be consistent later */
static char buff[32];
memset(buff, 0x0, 32);
- snprintf(buff, 32, "%d%d", (int)time(NULL), getpid());
+ snprintf(buff, 32, "%ld%d", (int)time(NULL), (long) getpid());
__osrfLogXidPfx = buff;
}
buf[1533] = '.';
buf[1534] = '.';
buf[1535] = '\0';
- syslog( fac | lvl, "[%s:%d:%s:%d:%s] %s", l, getpid(), filename, line, xid, buf );
+ syslog( fac | lvl, "[%s:%ld:%s:%d:%s] %s", l, (long) getpid(), filename, line, xid, buf );
}
else if( __osrfLogType == OSRF_LOG_TYPE_FILE )
- _osrfLogToFile("[%s:%d:%s:%d:%s] %s", l, getpid(), filename, line, xid, msg );
+ _osrfLogToFile("[%s:%ld:%s:%d:%s] %s", l, (long) getpid(), filename, line, xid, msg );
}
memset(buf, 0, RBUFSIZE);
set_fl(sock_fd, O_NONBLOCK);
- osrfLogInternal( OSRF_LOG_MARK, "%d : Received data at %f\n", getpid(), get_timestamp_millis());
+ osrfLogInternal( OSRF_LOG_MARK, "%ld : Received data at %f\n", (long) getpid(), get_timestamp_millis());
while( (read_bytes = recv(sock_fd, buf, RBUFSIZE-1, 0) ) > 0 ) {
osrfLogInternal( OSRF_LOG_MARK, "Socket %d Read %d bytes and data: %s", sock_fd, read_bytes, buf);