Commit 1f8962c2 authored by claes's avatar claes

mp_send errno print

parent 8d7cc252
/* /*
* Proview $Id: rt_errh.c,v 1.9 2006-07-07 07:06:55 claes Exp $ * Proview $Id: rt_errh.c,v 1.10 2006-07-10 10:55:23 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -120,7 +120,8 @@ typedef struct { ...@@ -120,7 +120,8 @@ typedef struct {
typedef pid_t sPid; typedef pid_t sPid;
static mqd_t mqid = (mqd_t)-1; static mqd_t mqid = (mqd_t)-1;
static unsigned int prio = 0;
static int mq_send_errno = 0;
#endif #endif
static const char *indentStr = " "; static const char *indentStr = " ";
...@@ -1093,11 +1094,13 @@ errh_send (char *s, char severity, pwr_tStatus sts, errh_eMsgType message_type) ...@@ -1093,11 +1094,13 @@ errh_send (char *s, char severity, pwr_tStatus sts, errh_eMsgType message_type)
len = sizeof(msg) - sizeof(msg.message_type) - sizeof(msg.str); len = sizeof(msg) - sizeof(msg.message_type) - sizeof(msg.str);
break; break;
} }
unsigned int prio = sysconf(_SC_MQ_PRIO_MAX) - 1; if ( prio == 0)
prio = sysconf(_SC_MQ_PRIO_MAX) - 1;
if (mq_send(mqid, (char *)&msg, MIN(len, LOG_MAX_MSG_SIZE - 1), prio) == -1) { if (mq_send(mqid, (char *)&msg, MIN(len, LOG_MAX_MSG_SIZE - 1), prio) == -1) {
/* if ( mq_send_errno != errno) {
perror("mq_send"); mq_send_errno = errno;
*/ perror("mq_send");
}
} }
} else { } else {
puts(s); puts(s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment