mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-24 20:05:04 +00:00
The channel open functions need to check for bad flags.
I set the newly created event elements to the default values in the B spec. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@710 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
cbc8feca89
commit
603e49e662
12
lib/evt.c
12
lib/evt.c
@ -876,6 +876,11 @@ saEvtChannelOpen(
|
||||
return SA_AIS_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if ((channelOpenFlags & ~(SA_EVT_CHANNEL_CREATE|SA_EVT_CHANNEL_PUBLISHER|
|
||||
SA_EVT_CHANNEL_SUBSCRIBER)) != 0) {
|
||||
return SA_AIS_ERR_BAD_FLAGS;
|
||||
}
|
||||
|
||||
error = saHandleInstanceGet(&evt_instance_handle_db, evtHandle,
|
||||
(void*)&evti);
|
||||
|
||||
@ -1076,6 +1081,11 @@ saEvtChannelOpenAsync(SaEvtHandleT evtHandle,
|
||||
return SA_AIS_ERR_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if ((channelOpenFlags & ~(SA_EVT_CHANNEL_CREATE|SA_EVT_CHANNEL_PUBLISHER|
|
||||
SA_EVT_CHANNEL_SUBSCRIBER)) != 0) {
|
||||
return SA_AIS_ERR_BAD_FLAGS;
|
||||
}
|
||||
|
||||
error = saHandleInstanceGet(&evt_instance_handle_db, evtHandle,
|
||||
(void*)&evti);
|
||||
|
||||
@ -1305,6 +1315,8 @@ saEvtEventAllocate(
|
||||
edi->edi_pub_node = evti->ei_node_id;
|
||||
edi->edi_priority = SA_EVT_LOWEST_PRIORITY;
|
||||
edi->edi_event_id = SA_EVT_EVENTID_NONE;
|
||||
edi->edi_pub_time = SA_TIME_UNKNOWN;
|
||||
edi->edi_retention_time = 0;
|
||||
hl = malloc(sizeof(*hl));
|
||||
edi->edi_hl = hl;
|
||||
hl->hl_handle = *eventHandle;
|
||||
|
Loading…
Reference in New Issue
Block a user