void-packages/srcpkgs/libowfat/patches/fix-glibc.patch
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

20 lines
473 B
Diff

diff --git a/io/iob_send.c b/io/iob_send.c
index 10a6e8c..81c2763 100644
--- a/io/iob_send.c
+++ b/io/iob_send.c
@@ -122,6 +122,14 @@ int64 iob_send(int64 s,io_batch* b) {
#include "io_internal.h"
#include "iob_internal.h"
+/*
+ * musl defines SO_ZEROCOPY 60 in sys/socket.h
+ * glibc doesn't, for whatever reason, so do it here
+ */
+#ifndef SO_ZEROCOPY
+#define SO_ZEROCOPY 60
+#endif
+
int64 iob_send(int64 s,io_batch* b) {
iob_entry* e,* last;
io_entry* E;