void-packages/srcpkgs/virtuoso/patches/use-mkstemp.patch
Đoàn Trần Công Danh 76acfa2dd2 srcpkgs/v*: 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

18 lines
587 B
Diff

Source: @pullmoll
Upstream: no
Reason: Avoid mktemp(3) because "Never use this function; see BUGS."
--- a/libsrc/Dk/Dksesstr.c 2018-08-16 01:06:21.000000000 +0200
+++ b/libsrc/Dk/Dksesstr.c 2020-01-27 15:22:00.953876251 +0100
@@ -298,8 +298,10 @@
if (!ses2->ses_file->ses_max_blocks_in_mem)
{
char fname[PATH_MAX + 1];
+ int fd;
snprintf (fname, sizeof (fname), "%s/sesXXXXXX", ses_tmp_dir);
- mktemp (fname);
+ fd = mkstemp (fname);
+ close (fd);
#if defined (WIN32)
# define OPEN_FLAGS O_CREAT | O_RDWR | O_BINARY | O_EXCL | O_TEMPORARY