X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fshm.c;h=3dbb9f4928a6d81b43c01fc1dbd4dbd3620ebf0c;hb=c0c0989ab70574e09b2f7e8b48c2da6af664a849;hp=566ed467fe2f715bc60f56449b222964c8b51acd;hpb=053e6e240f3fb5b2427fb28f8f09c652e2bdb39a;p=lttng-ust.git diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index 566ed467..3dbb9f49 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -1,21 +1,7 @@ /* - * libringbuffer/shm.c + * SPDX-License-Identifier: LGPL-2.1-only * * Copyright (C) 2005-2012 Mathieu Desnoyers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _LGPL_SOURCE @@ -149,12 +135,14 @@ struct shm_object *_shm_object_table_alloc_shm(struct shm_object_table *table, PERROR("zero_file"); goto error_zero_file; } + /* * Also ensure the file metadata is synced with the storage by using - * fsync(2). + * fsync(2). Some platforms don't allow fsync on POSIX shm fds, ignore + * EINVAL accordingly. */ ret = fsync(shmfd); - if (ret) { + if (ret && errno != EINVAL) { PERROR("fsync"); goto error_fsync; }