www/firefox: unbreak native Wayland if XDG_RUNTIME_DIR on ZFS

XDG_RUNTIME_DIR should be on tmpfs(5) for optimal performance but if
users want on permanent storage like ZFS don't abort.

PR:		240884
Reported by:	jsm
This commit is contained in:
Jan Beich 2020-02-28 18:20:53 +00:00
parent f0c52cc7bc
commit fafd21c920
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=527346
8 changed files with 140 additions and 4 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= thunderbird
DISTVERSION= 68.5.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= mail news net-im
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source

View File

@ -0,0 +1,34 @@
[Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem.
diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.cpp
index 9a73326399bd5..9e42a7f1c5d18 100644
--- widget/gtk/WindowSurfaceWayland.cpp
+++ widget/gtk/WindowSurfaceWayland.cpp
@@ -235,23 +235,24 @@
#ifdef HAVE_POSIX_FALLOCATE
do {
ret = posix_fallocate(fd, 0, aSize);
} while (ret == EINTR);
- if (ret != 0) {
+ if (ret == 0) {
+ return fd;
+ } else if (ret != EINVAL && ret != EOPNOTSUPP) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF(
"posix_fallocate() fails on %s size %d error code %d\n", filename,
aSize, ret);
}
-#else
+#endif
do {
ret = ftruncate(fd, aSize);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
filename, aSize, ret);
}
-#endif
return fd;
}

View File

@ -2,7 +2,7 @@
PORTNAME= cliqz
DISTVERSION= 1.33.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= www
MASTER_SITES= https://s3.amazonaws.com/cdn.cliqz.com/browser-f/APT/:amazon \
http://repository.cliqz.com/dist/${CLIQZ_CHANNEL}/${DISTVERSION}/${CLIQZ_LAST_BUILD_ID}/:cliqz

View File

@ -0,0 +1,34 @@
[Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem.
diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.cpp
index 9a73326399bd5..9e42a7f1c5d18 100644
--- mozilla-release/widget/gtk/WindowSurfaceWayland.cpp
+++ mozilla-release/widget/gtk/WindowSurfaceWayland.cpp
@@ -235,23 +235,24 @@
#ifdef HAVE_POSIX_FALLOCATE
do {
ret = posix_fallocate(fd, 0, aSize);
} while (ret == EINTR);
- if (ret != 0) {
+ if (ret == 0) {
+ return fd;
+ } else if (ret != EINVAL && ret != EOPNOTSUPP) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF(
"posix_fallocate() fails on %s size %d error code %d\n", filename,
aSize, ret);
}
-#else
+#endif
do {
ret = ftruncate(fd, aSize);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
filename, aSize, ret);
}
-#endif
return fd;
}

View File

@ -3,7 +3,7 @@
PORTNAME= firefox
DISTVERSION= 68.5.0
PORTREVISION= 2
PORTREVISION= 3
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source \

View File

@ -0,0 +1,34 @@
[Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem.
diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.cpp
index 9a73326399bd5..9e42a7f1c5d18 100644
--- widget/gtk/WindowSurfaceWayland.cpp
+++ widget/gtk/WindowSurfaceWayland.cpp
@@ -235,23 +235,24 @@
#ifdef HAVE_POSIX_FALLOCATE
do {
ret = posix_fallocate(fd, 0, aSize);
} while (ret == EINTR);
- if (ret != 0) {
+ if (ret == 0) {
+ return fd;
+ } else if (ret != EINVAL && ret != EOPNOTSUPP) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF(
"posix_fallocate() fails on %s size %d error code %d\n", filename,
aSize, ret);
}
-#else
+#endif
do {
ret = ftruncate(fd, aSize);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
filename, aSize, ret);
}
-#endif
return fd;
}

View File

@ -3,7 +3,7 @@
PORTNAME= firefox
DISTVERSION= 73.0.1
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \

View File

@ -0,0 +1,34 @@
[Wayland] Fall back to ftruncate if posix_fallocate isn't supported by filesystem.
diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.cpp
index 9a73326399bd5..9e42a7f1c5d18 100644
--- widget/gtk/WindowSurfaceWayland.cpp
+++ widget/gtk/WindowSurfaceWayland.cpp
@@ -235,23 +235,24 @@
#ifdef HAVE_POSIX_FALLOCATE
do {
ret = posix_fallocate(fd, 0, aSize);
} while (ret == EINTR);
- if (ret != 0) {
+ if (ret == 0) {
+ return fd;
+ } else if (ret != EINVAL && ret != EOPNOTSUPP) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF(
"posix_fallocate() fails on %s size %d error code %d\n", filename,
aSize, ret);
}
-#else
+#endif
do {
ret = ftruncate(fd, aSize);
} while (ret < 0 && errno == EINTR);
if (ret < 0) {
close(fd);
MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
filename, aSize, ret);
}
-#endif
return fd;
}