void-packages/srcpkgs/vlc/patches/fix-waitpid-usage.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

58 lines
1.9 KiB
Diff

--- a/modules/misc/inhibit/xdg.c 2015-02-28 08:48:24.264968381 -0200
+++ b/modules/misc/inhibit/xdg.c 2015-02-28 08:48:43.081636013 -0200
@@ -26,6 +26,7 @@
#include <vlc_plugin.h>
#include <vlc_inhibit.h>
#include <assert.h>
+#include <errno.h>
#include <signal.h>
#include <spawn.h>
#include <sys/wait.h>
@@ -65,7 +66,7 @@
{
int status;
- while (waitpid (pid, &status, 0) == -1);
+ while (waitpid (pid, &status, 0) == -1 && errno != ECHILD);
}
else
msg_Warn (ih, "error starting xdg-screensaver: %s",
--- a/modules/stream_filter/decomp.c 2018-04-25 01:54:04.472412122 +0200
+++ b/modules/stream_filter/decomp.c 2018-04-25 01:55:13.065411209 +0200
@@ -330,7 +330,7 @@
if (ret != VLC_SUCCESS)
{
if (p_sys->pid != -1)
- while (waitpid (p_sys->pid, &(int){ 0 }, 0) == -1);
+ while (waitpid (p_sys->pid, &(int){ 0 }, 0) == -1 && errno != ECHILD);
vlc_mutex_destroy (&p_sys->lock);
vlc_cond_destroy (&p_sys->wait);
free (p_sys);
@@ -361,7 +361,7 @@
vlc_close (p_sys->write_fd);
msg_Dbg (obj, "waiting for PID %u", (unsigned)p_sys->pid);
- while (waitpid (p_sys->pid, &status, 0) == -1);
+ while (waitpid (p_sys->pid, &status, 0) == -1 && errno != ECHILD);
msg_Dbg (obj, "exit status %d", status);
vlc_mutex_destroy (&p_sys->lock);
--- a/src/posix/netconf.c 2018-04-25 01:55:26.929411024 +0200
+++ b/src/posix/netconf.c 2018-04-25 01:56:29.878410186 +0200
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <errno.h>
#include <fcntl.h>
#include <spawn.h>
#include <unistd.h>
@@ -99,7 +100,7 @@
while (len < sizeof (buf));
vlc_close(fd[0]);
- while (waitpid(pid, &(int){ 0 }, 0) == -1);
+ while (waitpid(pid, &(int){ 0 }, 0) == -1 && errno != ECHILD);
if (len >= 9 && !strncasecmp(buf, "direct://", 9))
return NULL;