-static void msg_dump_queue(void)
-{
-#ifdef DEBUG
- struct uevent_msg *msg;
-
- list_for_each_entry(msg, &msg_list, node)
- dbg("sequence %llu in queue", msg->seqnum);
-#endif
-}
-
-static void msg_queue_delete(struct uevent_msg *msg)
-{
- list_del(&msg->node);
- free(msg);
-}
-
-/* orders the message in the queue by sequence number */
-static void msg_queue_insert(struct uevent_msg *msg)
-{
- struct uevent_msg *loop_msg;
- struct sysinfo info;
-
- if (msg->seqnum == 0) {
- dbg("no SEQNUM, move straight to the exec queue");
- list_add_tail(&msg->node, &exec_list);
- run_exec_q = 1;
- return;
- }
-
- /* store timestamp of queuing */
- sysinfo(&info);
- msg->queue_time = info.uptime;
-
- /* with the first event we provide a phase of shorter timeout */
- if (init_phase) {
- static long init_time;
-
- if (init_time == 0)
- init_time = info.uptime;
- if (info.uptime - init_time >= UDEVD_INIT_TIME)
- init_phase = 0;
- }
-
- /* sort message by sequence number into list */
- list_for_each_entry_reverse(loop_msg, &msg_list, node) {
- if (loop_msg->seqnum < msg->seqnum)
- break;
-
- if (loop_msg->seqnum == msg->seqnum) {
- dbg("ignoring duplicate message seq %llu", msg->seqnum);
- free(msg);
- return;
- }
- }
- list_add(&msg->node, &loop_msg->node);
- info("seq %llu queued, '%s' '%s'", msg->seqnum, msg->action, msg->devpath);
-
- /* run msg queue manager */
- run_msg_q = 1;
-
- return;
-}
-