Skip to content

Another dlt-dameon recreate fifo file before exit error #569

@jack-liuhang

Description

@jack-liuhang

static int dlt_daemon_init_fifo(DltDaemonLocal *daemon_local)

static int dlt_daemon_init_fifo(DltDaemonLocal *daemon_local)
{
    int ret;
    int fd = -1;
    int fifo_size;

    /* open named pipe(FIFO) to receive DLT messages from users */
    umask(0);

    /* Try to delete existing pipe, ignore result of unlink */
    const char *tmpFifo = daemon_local->flags.daemonFifoName;
    unlink(tmpFifo);

    ret = mkfifo(tmpFifo, S_IRUSR | S_IWUSR | S_IWGRP);

if a dlt-daemon is running, and someone else startup another dlt-daemon again, and it will exit error because of binding ip/port confilct.
But this dlt-daemon will recreate FIFO file, and the first daemon cannot receive any message from FIFO because the old file is deleted

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions