Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>epel9
parent
a19b45c3f7
commit
dd0fb7654f
@ -1,28 +0,0 @@
|
||||
From 24e6cfa8097b8946db51f4076b59496a658fcbf5 Mon Sep 17 00:00:00 2001
|
||||
From: Igor Raits <i.gnatenko.brain@gmail.com>
|
||||
Date: Fri, 14 Feb 2020 20:45:19 +0100
|
||||
Subject: [PATCH] iothread: Add missing cstdint include
|
||||
|
||||
This will fix build with GCC 10+.
|
||||
|
||||
Fixes: https://github.com/fish-shell/fish-shell/issues/6604
|
||||
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
|
||||
---
|
||||
src/iothread.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/iothread.h b/src/iothread.h
|
||||
index 5d91b2b34..64f783e87 100644
|
||||
--- a/src/iothread.h
|
||||
+++ b/src/iothread.h
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
+#include <cstdint>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
--
|
||||
2.25.0
|
||||
|
@ -0,0 +1,56 @@
|
||||
From b54f5ba56e6315028186af5d9e3b914dfae5a74f Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Homborg <FHomborg@gmail.com>
|
||||
Date: Fri, 14 Feb 2020 17:18:27 +0100
|
||||
Subject: [PATCH 1/4] parser: Stop crashing when cwd isn't readable
|
||||
|
||||
Everything seems to be working, so instead of crashing just print an
|
||||
error and return.
|
||||
|
||||
Fixes #6597
|
||||
|
||||
(cherry picked from commit ceba851d44dea68b9e1b2b551e37fd6834767357)
|
||||
---
|
||||
src/parser.cpp | 2 +-
|
||||
tests/checks/init-unreadable-cwd.fish | 17 +++++++++++++++++
|
||||
2 files changed, 18 insertions(+), 1 deletion(-)
|
||||
create mode 100644 tests/checks/init-unreadable-cwd.fish
|
||||
|
||||
diff --git a/src/parser.cpp b/src/parser.cpp
|
||||
index 381b8ac06..1eae37392 100644
|
||||
--- a/src/parser.cpp
|
||||
+++ b/src/parser.cpp
|
||||
@@ -85,7 +85,7 @@ parser_t::parser_t(std::shared_ptr<env_stack_t> vars) : variables(std::move(vars
|
||||
int cwd = open_cloexec(".", O_RDONLY);
|
||||
if (cwd < 0) {
|
||||
perror("Unable to open the current working directory");
|
||||
- abort();
|
||||
+ return;
|
||||
}
|
||||
libdata().cwd_fd = std::make_shared<const autoclose_fd_t>(cwd);
|
||||
}
|
||||
diff --git a/tests/checks/init-unreadable-cwd.fish b/tests/checks/init-unreadable-cwd.fish
|
||||
new file mode 100644
|
||||
index 000000000..fee220847
|
||||
--- /dev/null
|
||||
+++ b/tests/checks/init-unreadable-cwd.fish
|
||||
@@ -0,0 +1,17 @@
|
||||
+#RUN: %fish -C 'set -g fish %fish' %s
|
||||
+# Test that fish doesn't crash if cwd is unreadable at the start (#6597)
|
||||
+
|
||||
+set -l oldpwd $PWD
|
||||
+set -l tmpdir (mktemp -d)
|
||||
+
|
||||
+# $fish might be a relative path (e.g. "../test/root/bin/fish")
|
||||
+set -l fish (builtin realpath $fish)
|
||||
+cd $tmpdir
|
||||
+chmod 000 .
|
||||
+$fish -c 'echo Look Ma! No crashing!'
|
||||
+#CHECK: Look Ma! No crashing!
|
||||
+#CHECKERR: Unable to open the current working directory: Permission denied
|
||||
+
|
||||
+# Careful here, Solaris' rm tests if the directory is in $PWD, so we need to cd back
|
||||
+cd $oldpwd
|
||||
+rmdir $tmpdir
|
||||
--
|
||||
2.25.0
|
||||
|
@ -0,0 +1,31 @@
|
||||
From ca740a87d86009badba0b4e767836eaee449e0a4 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Homborg <FHomborg@gmail.com>
|
||||
Date: Fri, 14 Feb 2020 20:41:17 +0100
|
||||
Subject: [PATCH 2/4] iothread: Include cstdint
|
||||
|
||||
For uint64_t.
|
||||
|
||||
Needed for some configurations with glibc.
|
||||
|
||||
Fixes #6604.
|
||||
|
||||
(cherry picked from commit d80d39dd6a0576e5923184815832b0938356530c)
|
||||
---
|
||||
src/iothread.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/iothread.cpp b/src/iothread.cpp
|
||||
index 21017fbe7..9e252260b 100644
|
||||
--- a/src/iothread.cpp
|
||||
+++ b/src/iothread.cpp
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
+#include <cstdint> // for uint64_t
|
||||
#include <functional>
|
||||
#include <queue>
|
||||
|
||||
--
|
||||
2.25.0
|
||||
|
@ -0,0 +1,44 @@
|
||||
From ebf8bc0db4a089c575e9208c07fd8ae8c869c7da Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Homborg <FHomborg@gmail.com>
|
||||
Date: Fri, 14 Feb 2020 20:51:54 +0100
|
||||
Subject: [PATCH 3/4] iothread: include cstdint, correctly
|
||||
|
||||
Yeah, this was needed in the *header*.
|
||||
|
||||
God I hate headers.
|
||||
|
||||
Fixes #6604, for real this time
|
||||
|
||||
(cherry picked from commit f79ff7209627cc12e55cadf8b275a00ed4a378e7)
|
||||
---
|
||||
src/iothread.cpp | 1 -
|
||||
src/iothread.h | 1 +
|
||||
2 files changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/iothread.cpp b/src/iothread.cpp
|
||||
index 9e252260b..21017fbe7 100644
|
||||
--- a/src/iothread.cpp
|
||||
+++ b/src/iothread.cpp
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
-#include <cstdint> // for uint64_t
|
||||
#include <functional>
|
||||
#include <queue>
|
||||
|
||||
diff --git a/src/iothread.h b/src/iothread.h
|
||||
index 5d91b2b34..bdb045dfc 100644
|
||||
--- a/src/iothread.h
|
||||
+++ b/src/iothread.h
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
+#include <cstdint> // for uint64_t
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
--
|
||||
2.25.0
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 4d2bb0681fab9ffa019483974a8bca8551ec5d7f Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Homborg <FHomborg@gmail.com>
|
||||
Date: Sat, 15 Feb 2020 10:10:59 +0100
|
||||
Subject: [PATCH 4/4] Fix build on 32-bit systems
|
||||
|
||||
This was a weird case of the integer converseys.
|
||||
|
||||
Fixes #6609.
|
||||
|
||||
(cherry picked from commit 399a71645e76ec103c32dae4caa0778b4bf57eaa)
|
||||
---
|
||||
src/wutil.cpp | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/wutil.cpp b/src/wutil.cpp
|
||||
index ea7bdf694..1d1f0764a 100644
|
||||
--- a/src/wutil.cpp
|
||||
+++ b/src/wutil.cpp
|
||||
@@ -305,10 +305,11 @@ int fd_check_is_remote(int fd) {
|
||||
}
|
||||
// Linux has constants for these like NFS_SUPER_MAGIC, SMB_SUPER_MAGIC, CIFS_MAGIC_NUMBER but
|
||||
// these are in varying headers. Simply hard code them.
|
||||
- switch (buf.f_type) {
|
||||
+ // NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER
|
||||
+ switch ((unsigned int)buf.f_type) {
|
||||
case 0x6969: // NFS_SUPER_MAGIC
|
||||
case 0x517B: // SMB_SUPER_MAGIC
|
||||
- case 0xFF534D42: // CIFS_MAGIC_NUMBER
|
||||
+ case 0xFF534D42u: // CIFS_MAGIC_NUMBER
|
||||
return 1;
|
||||
default:
|
||||
// Other FSes are assumed local.
|
||||
--
|
||||
2.25.0
|
||||
|
Binary file not shown.
@ -1 +1,2 @@
|
||||
SHA512 (fish-3.1.0.tar.gz) = 143e462b5329790fa9834e135109e1397c3525756a0209d0ec68a53f7d2a1f581cd45fbbdcde6a5b53dff447da18ed6a62277993d851e7b18ef7f1a6b6d49cff
|
||||
SHA512 (fish-3.1.0.tar.gz.asc) = 7d99a513653298ea1866445bb9a29f5c6844f49ab6354993eee4416d427061926b351ecf511ac53692feafa73878a473a80c8122d3d9f240789797e0708807f4
|
||||
|
Loading…
Reference in new issue