Rename os_create_anonymous_file to weston_os_create_anonymous_file

This avoids a conflict with the os_create_anonymous_file function in wayland-cursor.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
This commit is contained in:
Jordan Williams 2024-03-04 10:22:23 -06:00
parent 215cceb45d
commit 81a1b99e2c
No known key found for this signature in database
GPG key ID: 9FB42B0E7F657D8C
17 changed files with 20 additions and 20 deletions

View file

@ -622,7 +622,7 @@ static int
shm_pool_init(struct shm_pool *pool, size_t size, struct wl_shm *wl_shm)
{
size_t pool_size = size * ARRAY_LENGTH(pool->buffers);
int fd = os_create_anonymous_file(pool_size);
int fd = weston_os_create_anonymous_file(pool_size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %zu B failed: %s\n",

View file

@ -805,7 +805,7 @@ createShmBuffer(struct wlContextStruct *p_wlCtx)
size = stride * height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -102,7 +102,7 @@ attach_buffer(struct window *window, int width, int height)
stride = width * 4;
size = stride * height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -143,7 +143,7 @@ create_shm_buffers(struct display *display, struct buffer **buffers,
stride = width * 4;
size = stride * height * num_buffers;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -112,7 +112,7 @@ screenshot_create_shm_buffer(struct screenshooter_app *app,
assert(width == stride / bytes_pp);
assert(height == buffer->len / stride);
fd = os_create_anonymous_file(buffer->len);
fd = weston_os_create_anonymous_file(buffer->len);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %zd B failed: %s\n",
buffer->len, strerror(errno));

View file

@ -122,7 +122,7 @@ create_shm_buffer(struct display *display, struct buffer *buffer,
pitch = width * 4;
size = pitch * height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -167,7 +167,7 @@ create_shm_buffer(struct window *window, struct buffer *buffer, uint32_t format)
size = stride * height;
display = window->display;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -86,7 +86,7 @@ create_shm_buffer(struct touch *touch)
stride = touch->width * 4;
size = stride * touch->height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -602,7 +602,7 @@ make_shm_pool(struct display *display, int size, void **data)
struct wl_shm_pool *pool;
int fd;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View file

@ -470,9 +470,9 @@ shared_output_get_shm_buffer(struct shared_output *so)
return sb;
}
fd = os_create_anonymous_file(height * stride);
fd = weston_os_create_anonymous_file(height * stride);
if (fd < 0) {
weston_log("os_create_anonymous_file: %s\n", strerror(errno));
weston_log("weston_os_create_anonymous_file: %s\n", strerror(errno));
return NULL;
}

View file

@ -331,7 +331,7 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
fd = os_create_anonymous_file(height * stride);
fd = weston_os_create_anonymous_file(height * stride);
if (fd < 0) {
weston_log("could not create an anonymous file buffer: %s\n",
strerror(errno));

View file

@ -542,7 +542,7 @@ weston_dmabuf_feedback_format_table_create(const struct weston_drm_format_array
/* Creates formats file table and mmap it */
format_table->size = weston_drm_format_array_count_pairs(renderer_formats) *
sizeof(*format_table->data);
format_table->fd = os_create_anonymous_file(format_table->size);
format_table->fd = weston_os_create_anonymous_file(format_table->size);
if (format_table->fd < 0) {
weston_log("error: failed to create format table file: %s\n",
strerror(errno));

View file

@ -175,7 +175,7 @@ create_tmpfile_cloexec(char *tmpname)
* XDG_RUNTIME_DIR.
*/
int
os_create_anonymous_file(off_t size)
weston_os_create_anonymous_file(off_t size)
{
static const char template[] = "/weston-shared-XXXXXX";
const char *path;
@ -278,7 +278,7 @@ os_ro_anonymous_file_create(size_t size,
}
file->size = size;
file->fd = os_create_anonymous_file(size);
file->fd = weston_os_create_anonymous_file(size);
if (file->fd == -1)
goto err_free;
@ -369,7 +369,7 @@ os_ro_anonymous_file_get_fd(struct ro_anonymous_file *file,
/* for all other cases we create a new anonymous file that can be mapped
* with MAP_SHARED and copy the contents to it and return that instead
*/
fd = os_create_anonymous_file(file->size);
fd = weston_os_create_anonymous_file(file->size);
if (fd == -1)
return fd;

View file

@ -43,7 +43,7 @@ int
os_epoll_create_cloexec(void);
int
os_create_anonymous_file(off_t size);
weston_os_create_anonymous_file(off_t size);
#ifndef HAVE_STRCHRNUL
char *

View file

@ -53,7 +53,7 @@ DECLARE_FIXTURE_SETUP(fixture_setup);
* behave like older clients, and allow ftruncate() to shrink the files size,
* so SIGBUS can still happen.
*
* There is no reason not to use os_create_anonymous_file() otherwise. */
* There is no reason not to use weston_os_create_anonymous_file() otherwise. */
#ifndef HAVE_MKOSTEMP
static int

View file

@ -503,7 +503,7 @@ create_shm_buffer(struct client *client, int width, int height,
buf->len = stride_bytes * height;
assert(buf->len / stride_bytes == (unsigned)height);
fd = os_create_anonymous_file(buf->len);
fd = weston_os_create_anonymous_file(buf->len);
assert(fd >= 0);
data = mmap(NULL, buf->len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

View file

@ -88,7 +88,7 @@ yuv_buffer_create(struct client *client,
buf->width = width;
buf->height = height;
fd = os_create_anonymous_file(buf->bytes);
fd = weston_os_create_anonymous_file(buf->bytes);
assert(fd >= 0);
buf->data = mmap(NULL, buf->bytes,