X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fcompat%2Fmemstream.h;h=35ffa643d852403071473d1040c2f1d7dd0c67d8;hp=8dea7a44f13f5d5f79ae75c610eee4b04a15ebd2;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=578e048b5debf169e286e5b5cc747b5d6c16886d diff --git a/src/compat/memstream.h b/src/compat/memstream.h index 8dea7a44..35ffa643 100644 --- a/src/compat/memstream.h +++ b/src/compat/memstream.h @@ -1,30 +1,14 @@ -#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H -#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H - /* - * Copyright 2012 (c) - Mathieu Desnoyers - * - * memstream compatibility layer. + * SPDX-License-Identifier: MIT * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Copyright 2012 (c) Mathieu Desnoyers * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * memstream compatibility layer. */ +#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H +#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H + #ifdef BABELTRACE_HAVE_FMEMOPEN #include @@ -69,7 +53,7 @@ FILE *bt_fmemopen(void *buf, size_t size, const char *mode) /* Build a temporary filename */ tmpname = g_build_filename(g_get_tmp_dir(), "babeltrace-tmp-XXXXXX", NULL); - if (_mktemp(tmpname) == NULL) { + if (!_mktemp(tmpname)) { goto error_free; } @@ -217,7 +201,7 @@ FILE *bt_open_memstream(char **ptr, size_t *sizeloc) tmpname = g_build_filename(g_get_tmp_dir(), "babeltrace-tmp-XXXXXX", NULL); - if (_mktemp(tmpname) == NULL) { + if (!_mktemp(tmpname)) { goto error_free; }