aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/seccomp-filter.c
diff options
context:
space:
mode:
authorPaul Eggert2022-10-02 13:47:09 -0700
committerPaul Eggert2022-10-02 13:47:56 -0700
commit190582adf416790e072ec5a605bd43048a82784a (patch)
tree016f9ecbb2a92e5843953dfd0524f3aa56a8a3af /lib-src/seccomp-filter.c
parent5598886adc9f7bc83ba9775151f839d4691128e4 (diff)
downloademacs-190582adf416790e072ec5a605bd43048a82784a.tar.gz
emacs-190582adf416790e072ec5a605bd43048a82784a.zip
Don’t truncate seccomp-filter diagnostic
* lib-src/seccomp-filter.c (fail): Do not truncate diagnostic arbitrarily to 1000 bytes when ERROR is nonzero.
Diffstat (limited to 'lib-src/seccomp-filter.c')
-rw-r--r--lib-src/seccomp-filter.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib-src/seccomp-filter.c b/lib-src/seccomp-filter.c
index 061af9dc072..041bf5c749b 100644
--- a/lib-src/seccomp-filter.c
+++ b/lib-src/seccomp-filter.c
@@ -69,19 +69,16 @@ fail (int error, const char *format, ...)
69{ 69{
70 va_list ap; 70 va_list ap;
71 va_start (ap, format); 71 va_start (ap, format);
72 vfprintf (stderr, format, ap);
73 va_end (ap);
72 if (error == 0) 74 if (error == 0)
73 { 75 fputc ('\n', stderr);
74 vfprintf (stderr, format, ap);
75 fputc ('\n', stderr);
76 }
77 else 76 else
78 { 77 {
79 char buffer[1000]; 78 fputs (": ", stderr);
80 vsnprintf (buffer, sizeof buffer, format, ap);
81 errno = error; 79 errno = error;
82 perror (buffer); 80 perror (NULL);
83 } 81 }
84 va_end (ap);
85 fflush (NULL); 82 fflush (NULL);
86 exit (EXIT_FAILURE); 83 exit (EXIT_FAILURE);
87} 84}