The Samba-Bugzilla – Attachment 13506 Details for
Bug 12987
[tevent] FD errors are not propagated when waiting for writeability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
tevent.c
tevent.c (text/x-csrc), 1.39 KB, created by
Robbie Harwood
on 2017-08-25 17:48:53 UTC
(
hide
)
Description:
tevent.c
Filename:
MIME Type:
Creator:
Robbie Harwood
Created:
2017-08-25 17:48:53 UTC
Size:
1.39 KB
patch
obsolete
>#include <tevent.h> >#include <stdio.h> >#include <unistd.h> > >static void timer_cb(struct tevent_context *c, struct tevent_timer *e, > struct timeval ct, void *data) { > printf("[timer_cb]; error!\n"); > exit(-1); >} > >static void error_cb(struct tevent_context *c, struct tevent_fd *e, > uint16_t fl, void *data) { > printf("blue skied an' clear\n"); > exit(0); >} > >int main() { > int ret, fds[2]; > struct tevent_context *c; > struct timeval tv; > struct tevent_timer *timer; > struct tevent_fd *tfd; > > fds[0] = -1; > fds[1] = -1; > > ret = pipe(fds); > if (ret != 0) { > printf("pipe\n"); > exit(-1); > } > > c = tevent_context_init(NULL); > if (!c) { > printf("tevent_context_init\n"); > exit(-1); > } > > tv = tevent_timeval_current_ofs(1, 1000); > timer = tevent_add_timer(c, c, tv, timer_cb, (void *) c); > if (!timer) { > printf("tevent_add_timer\n"); > exit(-1); > } > > close(fds[0]); > fds[0] = -1; > > tfd = tevent_add_fd(c, c, fds[1], 0, error_cb, (void *) c); > if (!tfd) { > printf("tevent_add_fd\n"); > exit(-1); > } > tevent_fd_set_flags(tfd, TEVENT_FD_READ); > > while (1) { > printf("[tevent_loop_once]\n"); > ret = tevent_loop_once(c); > if (ret) { > printf("tevent_loop_once\n"); > exit(-1); > } > } > > return -1; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 12987
: 13506