Package: zzuf Version: 0.8-1 Severity: normal Tags: patch In offset_check(), errno needs to be saved. Not doing that breaks e.g. X clients.
zzuf is also extra verbose, is that "data on fd %i for process %i" --
forgotten debug output?
I suggest the attached patch to fix these issues.
Sami
--- zzuf-0.8.orig/src/lib-fd.c
+++ zzuf-0.8/src/lib-fd.c
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <errno.h>
#if defined HAVE_WINSOCK2_H
# include <winsock2.h>
@@ -492,6 +493,7 @@
static void offset_check(int fd)
{
/* Sanity check, can be OK though (for instance with a character device) */
+ int orig_errno = errno;
#if defined HAVE_LSEEK64
off64_t ret;
LOADSYM(lseek64);
@@ -503,5 +505,6 @@
#endif
if(ret != -1 && ret != _zz_getpos(fd))
debug("warning: offset inconsistency");
+ errno = orig_errno;
}
--- zzuf-0.8.orig/src/zzuf.c
+++ zzuf-0.8/src/zzuf.c
@@ -755,7 +755,7 @@
if(!ZZUF_FD_ISSET(opts->child[i].fd[j], &fdset))
continue;
-fprintf(stderr, "data on fd %i for process %i\n", j, i);
+ /*fprintf(stderr, "data on fd %i for process %i\n", j, i);*/
ret = read(opts->child[i].fd[j], buf, BUFSIZ - 1);
if(ret > 0)
-- System Information:
Debian Release: 4.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-amd64
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)
Versions of packages zzuf depends on:
ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries
zzuf recommends no packages.
-- no debconf information
signature.asc
Description: Digital signature

