Remove unnecessary os_procName and os_procNamePid functions

Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
This commit is contained in:
Jeroen Koekkoek 2018-12-28 11:06:39 +01:00
parent a2aab8eab2
commit 0bc263e537
34 changed files with 33 additions and 455 deletions

View file

@ -149,17 +149,10 @@ dds_init(dds_domainid_t domain)
/* Set additional default participant properties */
gv.default_plist_pp.process_id = (unsigned)os_procIdSelf();
gv.default_plist_pp.process_id = (unsigned)os_getpid();
gv.default_plist_pp.present |= PP_PRISMTECH_PROCESS_ID;
if (os_procName(progname, sizeof(progname)) > 0)
{
gv.default_plist_pp.exec_name = dds_string_dup(progname);
}
else
{
gv.default_plist_pp.exec_name = dds_string_alloc(32);
(void) snprintf(gv.default_plist_pp.exec_name, 32, "%s: %u", DDSC_PROJECT_NAME, gv.default_plist_pp.process_id);
}
gv.default_plist_pp.exec_name = dds_string_alloc(32);
(void) snprintf(gv.default_plist_pp.exec_name, 32, "%s: %u", DDSC_PROJECT_NAME, gv.default_plist_pp.process_id);
len = (uint32_t) (13 + strlen(gv.default_plist_pp.exec_name));
gv.default_plist_pp.present |= PP_PRISMTECH_EXEC_NAME;
if (os_gethostname(hostname, sizeof(hostname)) == os_resultSuccess)

View file

@ -41,7 +41,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -47,7 +47,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -51,7 +51,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -312,7 +312,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -68,7 +68,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -68,7 +68,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -61,7 +61,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -65,7 +65,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -85,7 +85,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -43,7 +43,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -69,7 +69,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -38,7 +38,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -43,7 +43,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;

View file

@ -61,7 +61,7 @@ static char*
create_topic_name(const char *prefix, char *name, size_t size)
{
/* Get semi random g_topic name. */
os_procId pid = os_procIdSelf();
os_procId pid = os_getpid();
uintmax_t tid = os_threadIdToInteger(os_threadIdSelf());
(void) snprintf(name, size, "%s_pid%"PRIprocId"_tid%"PRIuMAX"", prefix, pid, tid);
return name;