Tcl Source Code

Check-in [ad84a95758]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix timeout calculation in epoll-based notifier. Proposed fix for [1a6a36d901]. Patch by Lucio Andrés Illanes Albornoz. Thanks!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:ad84a957586c19b2286b371a35d320dde3bb836617597904064901b8b965f526
User & Date: jan.nijtmans 2017-10-27 07:26:15
Context
2017-10-27
12:04
merge mark check-in: 7446fb0672 user: dgp tags: trunk
09:21
merge trunk. Change various TCL_LINK_? macros to TCL_TYPE_? check-in: 5e0b71621b user: jan.nijtmans tags: tip-312
08:45
First implementation of TIP #481: Extend size range o... check-in: 3d8b34236d user: jan.nijtmans tags: tip-481
07:26
Fix timeout calculation in epoll-based notifier. Proposed fix for [1a6a36d901dedead248ea96df09d5dc15... check-in: ad84a95758 user: jan.nijtmans tags: trunk
2017-10-24
13:56
Change (internal) refCount field from TclRegexp to type size_t: this allows more references on 64-bi... check-in: 689ce85f64 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to unix/tclEpollNotfy.c.

458
459
460
461
462
463
464
465



466
467
468
469
470
471
472
     */

    if (!timePtr) {
	timeout = -1;
    } else if (!timePtr->tv_sec && !timePtr->tv_usec) {
	timeout = 0;
    } else {
	timeout = (int)timePtr->tv_sec;



    }

    /*
     * Call (and possibly block on) epoll_wait(2) and substract the delta
     * of gettimeofday(2) before and after the call from timePtr if the
     * latter is not NULL. Return the number of events returned by epoll_wait(2).
     */







|
>
>
>







458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
     */

    if (!timePtr) {
	timeout = -1;
    } else if (!timePtr->tv_sec && !timePtr->tv_usec) {
	timeout = 0;
    } else {
	timeout = (int)timePtr->tv_sec * 1000;
	if (timePtr->tv_usec) {
	    timeout += (int)timePtr->tv_usec / 1000;
	}
    }

    /*
     * Call (and possibly block on) epoll_wait(2) and substract the delta
     * of gettimeofday(2) before and after the call from timePtr if the
     * latter is not NULL. Return the number of events returned by epoll_wait(2).
     */