~scoopta/wlrobs

Set mode when creating shm object v1 REJECTED

Jan Beich: 1
 Set mode when creating shm object

 1 files changed, 2 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~scoopta/wlrobs/patches/9093/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Set mode when creating shm object Export this patch

Similar to https://github.com/cyclopsian/wdisplays/pull/6

$ obs
[...]
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Wayland output' (wlrobs)
info: ------------------------------------------------
dup failed: Bad file descriptor
Abort

$ posixshmcontrol ls
MODE            OWNER   GROUP   SIZE    PATH
---------       foo     foo     33177600        /wlrobs
---
 src/outputs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/outputs.c b/src/outputs.c
index 56eb0d1..085733e 100644
--- a/src/outputs.c
+++ b/src/outputs.c
@@ -36,6 +36,7 @@
#include <stdarg.h>

#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

@@ -190,7 +191,7 @@ static int create_shm_file(size_t size, const char *fmt, ...) {
    return -1;
  }

  fd = shm_open(shm_name, O_CREAT | O_RDWR, 0);
  fd = shm_open(shm_name, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
  if (fd == -1) {
    fprintf(stderr, "shm_open: %s\n", strerror(errno));
    free(shm_name);
I marked this as superseded by the other patch