[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] Re: multipath tools racy on RUN file.
- From: Dave Olien <dmo osdl org>
- To: christophe varoqui free fr
- Cc: dm-devel redhat com
- Subject: [dm-devel] Re: multipath tools racy on RUN file.
- Date: Mon, 18 Oct 2004 16:52:51 -0700
By the way, this should cancel the alarm() after the fcntl()....
>
> fd = open(RUN, O_CREAT)
> if (fd < 0)
> error
>
> struct flock fl;
> fl.l_type = FWRLCK;
> fl.l_whence = 0;
> fl.l_start = 0;
> fl.l_len = 0;
> alarm(5); /* or however many seconds you want to wait */
> if (fcntl(fd, F_SETLKW, &fl) == -1) {
> if (errno == EINTR) /* timed out */
> else /* other error */
> }
alarm(0)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]