sync ports with The Matrix
This commit is contained in:
parent
c376d85ea0
commit
b6c01378e8
89 changed files with 898 additions and 818 deletions
31
sysutils/xxhash/patches/patch-cli_xsum_os_specific_c
Normal file
31
sysutils/xxhash/patches/patch-cli_xsum_os_specific_c
Normal file
|
@ -0,0 +1,31 @@
|
|||
Use pledge(2), xxhsum(1) only ever reads files or stdin.
|
||||
|
||||
Index: cli/xsum_os_specific.c
|
||||
--- cli/xsum_os_specific.c.orig
|
||||
+++ cli/xsum_os_specific.c
|
||||
@@ -69,6 +69,11 @@ static int XSUM_IS_CONSOLE(FILE* stdStream)
|
||||
|| defined(__DJGPP__) \
|
||||
|| defined(__MSYS__) \
|
||||
|| defined(__HAIKU__)
|
||||
+# ifdef __OpenBSD__
|
||||
+# include <errno.h> /* errno */
|
||||
+# include <string.h> /* strerror */
|
||||
+# include "xsum_output.h" /* XSUM_log */
|
||||
+# endif
|
||||
# include <unistd.h> /* isatty */
|
||||
# define XSUM_IS_CONSOLE(stdStream) isatty(fileno(stdStream))
|
||||
#elif defined(MSDOS) || defined(OS2)
|
||||
@@ -135,6 +140,13 @@ static int XSUM_stat(const char* infilename, XSUM_stat
|
||||
#ifndef XSUM_NO_MAIN
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
+#ifdef __OpenBSD__
|
||||
+ if (pledge("stdio rpath", NULL) == -1) {
|
||||
+ XSUM_log("pledge: %s\n", strerror(errno));
|
||||
+ return 1;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return XSUM_main(argc, argv);
|
||||
}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue