Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jack-liuhang opened this issue Nov 17, 2023 · 0 comments
Open

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

jack-liuhang opened this issue Nov 17, 2023 · 0 comments
Labels

Comments

@jack-liuhang
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants