:: Re: [DNG] vdev status update in dae…
Kezdőlap
Delete this message
Reply to this message
Szerző: aitor
Dátum:  
Címzett: dng
Tárgy: Re: [DNG] vdev status update in daedalus
I rectify some parts:


On 17/7/25 0:43, aitor wrote:
> /* ------------------ CODE ---------------------------- */
>
>
> int pipe[2];
>

Don't use this name, it's a function used after the declaration of the
pipe fd[2]:

int fd[2];

pipe(fd);


>
> // Fork
> pid = fork();
>
> // Parent process
> if (pid > 0) {
>
>         close(fd[0]);
>
>         /* Setup the polling part concerning to the pipe, and the rest
> as well */
>         pfd[FD_POLL_PIPE].fd = fd[1];
>         pfd[FD_POLL_PIPE].events = POLLIN;
>         ( .... )
>


Also, in my previous email I wrote "if (pid==0)", but pid=0 is the kernel:
>
> // Child process
> } else if (pid > 0) {
>
>         close(fd[1]);
>
>         // Coldplug processing
>
>         ( ..... )
> }
>
> /* ------------------- END -------------------- */
>