diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch b/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch new file mode 100644 index 0000000000..dd6fd87ae9 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 7a0632cad851826d804db0540d9a59773e6bf29c Mon Sep 17 00:00:00 2001 | ||
2 | From: Seebs <seebs@seebs.net> | ||
3 | Date: Wed, 28 Sep 2016 22:12:29 -0500 | ||
4 | Subject: [PATCH 2/2] Use correct file descriptor | ||
5 | |||
6 | So it turns out that pseudo_logfile() was returning 0 or -1, and | ||
7 | pseudo_debug_logfile() was expecting it to be the correct file descriptor | ||
8 | to use. And it's basically a mystery that any of that ever worked. | ||
9 | |||
10 | Signed-off-by: Seebs <seebs@seebs.net> | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
14 | --- | ||
15 | ChangeLog.txt | 3 +++ | ||
16 | pseudo_util.c | 3 ++- | ||
17 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/ChangeLog.txt b/ChangeLog.txt | ||
20 | index 4cc24de..49a6c36 100644 | ||
21 | --- a/ChangeLog.txt | ||
22 | +++ b/ChangeLog.txt | ||
23 | @@ -2,6 +2,9 @@ | ||
24 | * (seebs) Send errors to log when daemonizing, but do that a lot | ||
25 | sooner to prevent startup messages which can show up spuriously | ||
26 | with multiple clients. | ||
27 | + * (seebs) return file descriptor from pseudo_logfile, so we set | ||
28 | + pseudo_util_debug_fd to the right value instead of to stdin. | ||
29 | + Nice bug. | ||
30 | |||
31 | 2016-07-28: | ||
32 | * (seebs) Fix performance issue on deletion with xattr changes. | ||
33 | diff --git a/pseudo_util.c b/pseudo_util.c | ||
34 | index 0c156cf..a60c74b 100644 | ||
35 | --- a/pseudo_util.c | ||
36 | +++ b/pseudo_util.c | ||
37 | @@ -1569,7 +1569,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { | ||
38 | if (fd == -1) | ||
39 | return -1; | ||
40 | else | ||
41 | - return 0; | ||
42 | + return fd; | ||
43 | } | ||
44 | |||
45 | int | ||
46 | @@ -1579,6 +1579,7 @@ pseudo_debug_logfile(char *defname, int prefer_fd) { | ||
47 | |||
48 | fd = pseudo_logfile(filename, defname, prefer_fd); | ||
49 | if (fd > -1) { | ||
50 | + pseudo_diag("debug_logfile: fd %d\n", fd); | ||
51 | pseudo_util_debug_fd = fd; | ||
52 | return 0; | ||
53 | } | ||