Jim Tcl
Check-in [4d750fab2d]
Not logged in

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

Overview
Comment:aio tempname: Fix a crash when the template is invalid

Signed-off-by: Steve Bennett <steveb@workware.net.au>

Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d750fab2df3d30716e7c9ee6ec5e1027911a352
User & Date: steveb@workware.net.au 2017-10-15 20:57:05
Context
2017-10-15
21:00
eventloop: support sub-millisecond timer resolution

Timeouts may now be specified in fractions of milliseconds. e.g. after 0.5

This can be useful on faster systems where 1ms resolution is too coarse.

Also, use clock_gettime(CLOCK_MONOTONIC_RAW) for timers, if available. This clock is insensitive to system clock changes and ntp adjustments.

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 43fab94694 user: steveb@workware.net.au tags: trunk

20:57
aio tempname: Fix a crash when the template is invalid

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: 4d750fab2d user: steveb@workware.net.au tags: trunk

2017-09-22
03:53
scan: make some structure members const

Signed-off-by: Steve Bennett <steveb@workware.net.au> check-in: f859e0f23f user: steveb@workware.net.au tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to jim-aio.c.

2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
    }

    /* Update the template name directly with the filename */
    mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
    fd = mkstemp(filenameObj->bytes);
    umask(mask);
    if (fd < 0) {
        JimAioSetError(interp, filenameObj);
        Jim_FreeNewObj(interp, filenameObj);
        return -1;
    }

    Jim_SetResult(interp, filenameObj);
    return fd;
#else
    Jim_SetResultString(interp, "platform has no tempfile support", -1);







|
|







2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
    }

    /* Update the template name directly with the filename */
    mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
    fd = mkstemp(filenameObj->bytes);
    umask(mask);
    if (fd < 0) {
        Jim_IncrRefCount(filenameObj);
        Jim_SetResultFormatted(interp, "%#s: %s", filenameObj, strerror(errno));
        return -1;
    }

    Jim_SetResult(interp, filenameObj);
    return fd;
#else
    Jim_SetResultString(interp, "platform has no tempfile support", -1);